Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
是否可以使用VBA代码将单个ppt幻灯片复制并粘贴到publisher文档中?_Vba_Copy Paste_Powerpoint_Publisher - Fatal编程技术网

是否可以使用VBA代码将单个ppt幻灯片复制并粘贴到publisher文档中?

是否可以使用VBA代码将单个ppt幻灯片复制并粘贴到publisher文档中?,vba,copy-paste,powerpoint,publisher,Vba,Copy Paste,Powerpoint,Publisher,我正在尝试将许多ppt幻灯片(来自同一ppt)复制到现有的publisher文档中。我一直试图拼凑一段代码来完成这项工作,但由于缺乏经验,我无法理解 我最好只复制每张ppt幻灯片上的形状,如果ppt有任何更改,我可以更新publisher文档。使事情复杂化的是,在将幻灯片复制到publisher文档中时,是否有一种方法可以将所有幻灯片按行和列进行初始定位 这就是我目前所拥有的 Sub PPTSlidesToPublisher() 'Copy/Paste Power Point slides In

我正在尝试将许多ppt幻灯片(来自同一ppt)复制到现有的publisher文档中。我一直试图拼凑一段代码来完成这项工作,但由于缺乏经验,我无法理解

我最好只复制每张ppt幻灯片上的形状,如果ppt有任何更改,我可以更新publisher文档。使事情复杂化的是,在将幻灯片复制到publisher文档中时,是否有一种方法可以将所有幻灯片按行和列进行初始定位

这就是我目前所拥有的

Sub PPTSlidesToPublisher()
'Copy/Paste Power Point slides Into an existing Publisher document

'Copy Range from PPT
Set rng = ActivePresentation.Slides.Range

Dim appPub As New Publisher.Application

appPub.Open FileName:="filename.pub", _
ReadOnly:=False, AddToRecentFiles:=False, _
SaveChanges:=pbPromptToSaveChanges
appPub.ActiveWindow.Visible = True

Dim myDocument As Object
Dim myPage As Object
Dim myShape As Object


'Add a page to the Documenet
Dim shpSlide As Shape
Set rng = OLEObject
Set shpSlide = ActiveDocument.Pages(3).Shapes.AddOLEObject _
(Left:=2, Top:=5, ClassName:="Publisher.Application")

shpSlide.OLEFormat.Activate


End Sub