jo4884
Goto Top

Powerpoint slide in word erzeugen

Hallo, ich bin noch ein ziemlicher Neuling im Umgang mit VBA und bräuchte mal ein bißchen Hilfe.

Ich habe folgendes Problem.
In einem Word Dokument sind an verschiedenen Stellen Powerpoints als OLE eingefügt.
Mein Makro soll nun nacheinander die Powerpoints öffnen und die einzelnen Slides im Word Dokument direkt hinter der jeweiligen OLE Version einfügen.
Das öffnen und einfügen klappt schon, allerdings legt er die Slides nicht an die Richtige stelle.
Wie bekomm ich das hin?

Gruß und Dank an alle die mir Helfen!
Jo

Content-Key: 148001

Url: https://administrator.de/contentid/148001

Printed on: April 20, 2024 at 01:04 o'clock

Member: jo4884
jo4884 Aug 02, 2010 at 09:32:46 (UTC)
Goto Top
Hallo nochmal,

es wäre nett wenn mir mal jemand einen Tipp geben könnte, oder geht das überhaupt nicht?
Ich stell mal den Code des makros rein.

Sub pptSlides()

On Error Resume Next
Dim anzSlides, i, j, anzSeiten As Integer
Dim ins As InlineShape
Dim s As Shape
Dim folie
Dim pptApp, wordApp As Object
Dim NamePPT As String

i = 1

Set wordApp = GetObject(Class:="Word.Application")
anzSeiten = ActiveDocument.ComputeStatistics(wdStatisticPages)

For Each ins In ActiveDocument.InlineShapes

If i <= ActiveDocument.InlineShapes.Count Then
If ins.Type = wdInlineShapeEmbeddedOLEObject And ActiveDocument.InlineShapes(i).OLEFormat.ClassType = "PowerPoint.Show.8" Then

ActiveDocument.InlineShapes(i).OLEFormat.DoVerb (-2)
Set pptApp = GetObject(Class:="Powerpoint.Application")

anzSlides = pptApp.ActivePresentation.Slides.Count
NamePPT = pptApp.ActivePresentation.Name

If anzSlides > 1 Then

wordApp.ActiveDocument.Activate
Selection.EndKey Unit:=wdStory
Selection.InsertBreak Type:=wdPageBreak
Selection.TypeText Text:=NamePPT
Selection.TypeParagraph
Selection.TypeParagraph

For j = 1 To anzSlides
pptApp.ActivePresentation.Slides(j).Copy
wordApp.ActiveDocument.Activate
Selection.Paste
Next j
Else

End If

End If

i = i + 1
End If

Next

End Sub


Wäre echt Toll wenn mir mal jemand Antworten könnte!
Danke!