ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 Excel Home精品图文教程库
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
300集Office 2010微视频教程 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
查看: 2016|回复: 13

如何把word转换成ppt

[复制链接]

TA的精华主题

TA的得分主题

发表于 2020-4-4 16:32 | 显示全部楼层 |阅读模式
如何把word转换成ppt.rar (16.12 KB, 下载次数: 15)

如何把word转换成ppt,第一段放在第一张ppt上,第二段第二张ppt上,下同。
大纲视图方法太麻烦
Researchers believe they have solved one ofscience's greatest mysteries. They think they have found out why a dog's noseis cold. Scientists from universities in Sweden and Hungary have posited thatdogs' noses are constantly cold because they act as "ultra-sensitive heatdetectors". Canines can sense the temperature of something before theytouch it.
They added that dogs use their noses todetect tiny changes in temperature, such as when possible predators or prey arenearby. Humans generally only know something is hot after touching it, oftenwith painful consequences. It was common belief that the only reason dogs'noses are cold is to control and regulate their own body temperature.
The researchers conducted experiments onsixteen dogs that had to detect the temperature of different objects in a room.The objects had different temperatures that humans could only differentiate bytouching them. The scientists said that the brain activity in the dogs showedthat they could discern which objects were warmer than others.

TA的精华主题

TA的得分主题

发表于 2020-4-4 16:55 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
  1. Sub test()
  2.   Dim r%, i%
  3.   Dim arr()
  4.   Dim pptApp As PowerPoint.Application
  5.   Dim pptPre As PowerPoint.Presentation
  6.   Application.ScreenUpdating = False
  7.   Application.DisplayAlerts = False
  8.   m = 0
  9.   With ThisDocument
  10.     For i = 1 To .Paragraphs.Count
  11.       ss = .Paragraphs(i).Range.Text
  12.       ss = Left(ss, Len(ss) - 1)
  13.       If Len(ss) <> 0 Then
  14.         m = m + 1
  15.         ReDim Preserve arr(1 To m)
  16.         arr(m) = Replace(.Paragraphs(i).Range.Text, Chr(13), "")
  17.       End If
  18.     Next
  19.   End With
  20.   If m = 0 Then
  21.     MsgBox "Word文件中没有数据!"
  22.     Exit Sub
  23.   End If
  24.   
  25.   Set pptApp = New PowerPoint.Application
  26.   pptApp.Visible = msoTrue
  27.   Set pptPre = pptApp.Presentations.Add
  28.   With pptPre
  29.     For k = 1 To UBound(arr)
  30.       With .Slides.Add(Index:=.Slides.Count + 1, Layout:=ppLayoutTitleOnly)
  31.         ileft = (.CustomLayout.Width - 820) / 2
  32.         itop = (.CustomLayout.Height - 450) / 2
  33.         With .Shapes("Title 1")
  34.           .Left = ileft
  35.           .Top = itop
  36.           .Width = 820
  37.           .Height = 450
  38.           With .TextFrame
  39.             With .TextRange
  40.               .Text = arr(k)
  41.               With .Font
  42.                 .Name = "等线(正文)"
  43.                 .Size = 30
  44.                 .Bold = True
  45.               End With
  46.               .ParagraphFormat.Alignment = 1
  47.             End With
  48.           End With
  49.         End With
  50.       End With
  51.     Next
  52.     .SaveAs Filename = ThisDocument.Path & "\结果"
  53. '    .Close
  54.   End With
  55. '  pptApp.Quit
  56. '  Set pptPre = Nothing
  57. '  Set pptApp = Nothing
  58.   Application.ScreenUpdating = True
  59.   MsgBox "幻片生成完毕!"
  60. End Sub
复制代码

评分

2

查看全部评分

TA的精华主题

TA的得分主题

发表于 2020-4-4 16:57 | 显示全部楼层

TA的精华主题

TA的得分主题

 楼主| 发表于 2020-4-4 18:07 | 显示全部楼层
本帖最后由 zzpsx 于 2020-4-4 18:08 编辑

谢谢,非常厉害的高手作品,太强大了。要是能保留word文档的下划线,颜色等格式到ppt,那就更好了。 有格式的word文档.rar (17.35 KB, 下载次数: 7)

TA的精华主题

TA的得分主题

 楼主| 发表于 2020-4-4 18:19 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助

请问在word上能直接alt+f8运行这个代码吗?

TA的精华主题

TA的得分主题

发表于 2020-4-4 18:32 | 显示全部楼层
zzpsx 发表于 2020-4-4 18:07
谢谢,非常厉害的高手作品,太强大了。要是能保留word文档的下划线,颜色等格式到ppt,那就更好了。

保留这些格式非常繁琐。

TA的精华主题

TA的得分主题

 楼主| 发表于 2020-4-4 19:31 | 显示全部楼层
chxw68 发表于 2020-4-4 18:32
保留这些格式非常繁琐。

您说得对,还不如在ppt中运行代码批量加下划线或标红

TA的精华主题

TA的得分主题

 楼主| 发表于 2020-4-4 21:13 | 显示全部楼层

请问在word上能直接alt+f8运行这个代码吗?

TA的精华主题

TA的得分主题

发表于 2020-4-4 21:16 | 显示全部楼层
zzpsx 发表于 2020-4-4 21:13
请问在word上能直接alt+f8运行这个代码吗?

WORD上不是加了按钮吗?

TA的精华主题

TA的得分主题

 楼主| 发表于 2020-4-5 10:00 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
chxw68 发表于 2020-4-4 21:16
WORD上不是加了按钮吗?

如图不加按钮,能直接通过alt+F8运行代码吗?还是代码上要加一句?
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

关闭

最新热点上一条 /1 下一条

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-4-25 13:01 , Processed in 0.045263 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表