Dim PPPres As PowerPoint.Presentation '演示文稿。
Dim PPSlide As PowerPoint.Slide '幻燈片1。==Slide對象代表幻燈片。
Shell "Regsvr32.exe /u /s " & VBA.Chr(34) & "C:\Program Files\Common Files\System\ado\msado15.dll" & VBA.Chr(34), vbHide '註冊:解決實時錯誤429 activeX 部件不能創建對象:
Set pptApp = CreateObject("Powerpoint.Application") '創建powerpoint對象 ’實時錯誤 429 Active 不能創建對象
'Set pptApp = New PowerPoint.Application
'pptApp.Activate 'powerpoint對象被激活。
pptApp.Visible = True '使得ppt可見
pptApp.WindowState = PowerPoint.PpWindowState.ppWindowMaximized '最大化powerpoint窗口
' Set PPPres = pptApp.Presentations.Open(App.Path & "\AA.PPT", , , True) '打開選中的PowerPoint文檔
Set PPPres = pptApp.Presentations.Add(WithWindow:=True) '添加壹個新的演示文稿,並顯示
pptApp.Caption = "MW Interference Check"
PPPres.BuiltInDocumentProperties("Subject") = "ZTE-MW" '主題
PPPres.BuiltInDocumentProperties("Author") = "ZTE-WSQ" '作者 替代了ppPres.Author = "WSQ" '作者名稱
'ppPres.BuiltinDocumentProperties.Item("author").Value = "ZE_ZX"
PPPres.BuiltInDocumentProperties("Title") = "111"
PPPres.BuiltInDocumentProperties("Company") = "XiAn ZTE of China" '公司
PPPres.BuiltInDocumentProperties("Comments") = " Use only for ZTE" '備註,6個空格,以便對齊
PPPres.BuiltInDocumentProperties("Keywords") = "Do't copy" '關鍵字
PPPres.BuiltInDocumentProperties("Template") = "ZE ppt Template" '模板
PPPres.BuiltInDocumentProperties("Revision Number") = "155" '修訂版本號
PPPres.BuiltInDocumentProperties("Application Name") = "AntHeightCheck.EXE" '應用程序名
PPPres.BuiltInDocumentProperties("Manager") = "ZE" '管理器
PPPres.BuiltInDocumentProperties("Category") = "1 " '類別
PPPres.BuiltInDocumentProperties("Format") = "Good" '演示文稿格式
PPPres.BuiltInDocumentProperties("Creation Date") = "2010-02-28 02:28"
PPPres.BuiltInDocumentProperties("Last Author") = "ZTE WSQ"
PPPres.BuiltInDocumentProperties("Last Print Date") = "2010-09-28 02:28"
PPPres.BuiltInDocumentProperties("Last Save Time") = "2010-09-28 02:28"
PPPres.BuiltInDocumentProperties("Total Editing Time") = "15" '編輯時間總計
PPPres.BuiltInDocumentProperties("Number of Pages") = "3" '頁數
PPPres.BuiltInDocumentProperties("Number of Words") = "500" '字數
PPPres.BuiltInDocumentProperties("Number of Characters") = "28"
PPPres.BuiltInDocumentProperties("Security") = "201"
PPPres.BuiltInDocumentProperties("Number of Bytes") = "6060" '字節數
PPPres.BuiltInDocumentProperties("Number of Lines") = "100" '行數
PPPres.BuiltInDocumentProperties("Number of Paragraphs") = "100" '段落數
PPPres.BuiltInDocumentProperties("Number of Slides") = "1999" '幻燈片
PPPres.BuiltInDocumentProperties("Number of Notes") = "505" '備註
PPPres.BuiltInDocumentProperties("Number of Hidden Slides") = "101" '隱藏幻燈片
PPPres.BuiltInDocumentProperties("Number of Multimedia Clips") = "103" '多媒體剪輯
PPPres.BuiltInDocumentProperties("Last Print Date") = "1900-1-1" '必須為日期格式且不能為空,下同
'PPPres.BuiltInDocumentProperties("Hyperlink Base") = "@ZTE.CON.CN"
PPPres.BuiltInDocumentProperties("Number of Characters (with spaces)") = "9999" '字符(空格)數目
'==============以下為第1個幻燈片,首頁及其標題===================================
Set PPSlide = PPPres.Slides.Add(PPPres.Slides.Count + 1, PowerPoint.PpSlideLayout.ppLayoutTitleOnly) 'Add a new slide.'添加壹個新的幻燈片==只有標題 Layout:=ppLayoutBlank ppLayoutBlank
PPSlide.Shapes(PPSlide.Shapes.Count).TextFrame.TextRange.Text = "MW Interference Check" 'Add some text.標題文本
PPSlide.Shapes(PPSlide.Shapes.Count).TextFrame.TextRange.ParagraphFormat.Alignment = ppAlignCenter
PPSlide.Shapes(PPSlide.Shapes.Count).Left = 166
PPSlide.Shapes(PPSlide.Shapes.Count).Top = 105
PPSlide.Shapes(PPSlide.Shapes.Count).Height = 43
PPSlide.Shapes(PPSlide.Shapes.Count).width = 384
PPSlide.Shapes(PPSlide.Shapes.Count).TextFrame.TextRange.Font.Name = "宋體"
PPSlide.Shapes(PPSlide.Shapes.Count).TextFrame.TextRange.Font.size = 34
PPSlide.Shapes(PPSlide.Shapes.Count).TextFrame.TextRange.Font.Bold = True
PPSlide.Shapes(PPSlide.Shapes.Count).TextFrame.TextRange.Font.Color = vbRed
PPSlide.Shapes(PPSlide.Shapes.Count).TextFrame.TextRange.Font.Shadow = True
PPSlide.Shapes(PPSlide.Shapes.Count).Line.BackColor.RGB = RGB(0, 0, 0)
PPSlide.Shapes(PPSlide.Shapes.Count).Line.ForeColor.RGB = RGB(255, 255, 0)
PPSlide.Shapes(PPSlide.Shapes.Count).Line.Weight = 2
PPSlide.Shapes(PPSlide.Shapes.Count).Fill.BackColor.RGB = RGB(0, 0, 255)
PPSlide.Shapes(PPSlide.Shapes.Count).Fill.ForeColor.RGB = RGB(255, 255, 255)
PPSlide.Shapes(PPSlide.Shapes.Count).Fill.TwoColorGradient msoGradientFromCenter, 1 'PPSlide.Shapes.Range(PPSlide.Shapes.Count).Fill.PresetGradient msoGradientHorizontal, 1, 20 'Range填充==很好
'==============以下為兩豎線虛線=============================================
PPSlide.Shapes.AddLine 5, 17, 5, 507
PPSlide.Shapes(PPSlide.Shapes.Count).Line.DashStyle = 2 '1實線2虛線
PPSlide.Shapes(PPSlide.Shapes.Count).Line.Weight = 10
PPSlide.Shapes(PPSlide.Shapes.Count).Line.ForeColor.RGB = RGB(0, 255, 0)
PPSlide.Shapes.AddLine 715, 17, 715, 507
PPSlide.Shapes(PPSlide.Shapes.Count).Line.DashStyle = 2 '1實線2虛線
PPSlide.Shapes(PPSlide.Shapes.Count).Line.Weight = 10
PPSlide.Shapes(PPSlide.Shapes.Count).Line.ForeColor.RGB = RGB(0, 255, 0)
PPSlide.Shapes.AddLabel 1, 150, 510, 450, 28
PPSlide.Shapes(PPSlide.Shapes.Count).TextFrame.TextRange.Text = "溫馨提示:歡迎提出修改建議"
PPSlide.Shapes(PPSlide.Shapes.Count).TextFrame.TextRange.Font.Color = vbWhite
PPSlide.Shapes(PPSlide.Shapes.Count).TextFrame.TextRange.Font.size = 14
PPSlide.Shapes(PPSlide.Shapes.Count).TextFrame.TextRange.ParagraphFormat.Alignment = ppAlignLeft
'==============以上為兩豎線虛線============================================
InterferenceTJ PPSlide '幹擾統計圖表 '參數為Slide對象代表幻燈片。