vfp控制powerpoint转贴
启动 PowerPoint
7. PptApp = CreateObject("Powerpoint.Application")
8.
9. * 添加一个 presentation
10. PptPres = PptApp.Presentations.Add(1)
11.
12. * 添加一个幻灯片
13. PptSlide1 = PptPres.Slides.Add(1,2)
14.
15. * 添加一些文本...
16. PptSlide1.Shapes(1).TextFrame.TextRange.Text = "我的第一个幻灯片"
17. PptSlide1.Shapes(2).TextFrame.TextRange.Text = "Automating Powerpoint is easy" + Chr(13) + "Using FoxPro is fun!"
18.
19. * 添加另一个带一个图表的幻灯片,
20. PptSlide2 = PptPres.Slides.Add(2,5)
21.
22. * 添加一些文本
23. PptSlide2.Shapes(1).TextFrame.TextRange.Text = "Slide 2's topic"
24. PptSlide2.Shapes(1).TextFrame.TextRange.Text = "You can create and use charts in your Powerpoint slides!"
25.
26. * 添加一个图表当原来的...
27. With PptSlide2.Shapes(3)
28. cTop = .Top
29. cWidth = .Width
30. cHeight = .Height
31. cLeft = .Left
32. .Delete
33. EndWith
34.
35. PptSlide2.Shapes.AddOLEObject(cLeft, cTop, cWidth, cHeight, "MSGraph.Chart")
36.
37. * 添加另一个幻灯片, 带一个组织图表
38. PptSlide3 = PptPres.Slides.Add(3,7)
39.
40. * 添加一些文本
41. PptSlide3.Shapes(1).TextFrame.TextRange.Text = "The rest is only limited by your Imagination"
42.
43. * 添加一个 Org 图表...
44. With PptSlide3.Shapes(2)
45. cTop = .Top
46. cWidth = .Width
47. cHeight = .Height
48. cLeft = .Left
49. .Delete
50. EndWith
51.
52. PptSlide3.Shapes.AddOLEObject(cLeft, cTop, cWidth, cHeight, "OrgPlusWOPX.4")
53.
54. * 设置幻灯片的显示属性...
55. With PptPres.Slides.Range.SlideShowTransition
56. .EntryEffect = 513
57. .AdvanceOnTime = 1
58. .AdvanceTime = 5
59. EndWith
60.
61. * 准备并运行 slide-show!
62. With PptPres.SlideShowSettings
63. .ShowType = 3
64. .LoopUntilStopped = 1
65. .RangeType = 1
66. .AdvanceMode = 2
67. .Run
68. EndWith
69.
70. * 暂停让用户可以看到显示...
71. Wait window "Waiting for slide show to finish..." TIMEOUT 16
72.
73. * 停止幻灯片显示
74. PptPres.SlideShowWindow.View.Exit
75.
76. * 清除
77. PptApp.Quit
78. Release PptSlide3
79. Release PptSlide2
80. Release PptSlide1
81. Release PptPres
Release PptApp
问题点数:0、回复次数:0Top




