PowerPoint VBA - Form auf eine Folie kopieren
Ich habe eine Powerpoint VBA-Funktion entwickelt, an die ich ein Shape and Slide-Objekt übergebe.
Die Funktion sucht nach einer Form mit dem Text LOGO. Wenn sie gefunden wird, wird diese Form durch die Form ersetzt, die ich an die Funktion übergeben habe.
Function funktioniert perfekt in Office 2013, jedoch nicht in Office 2016.
Kann jemand bitte eine Lösung vorschlagen?
Public Sub AddLogo_ONE(shLogo As Shape, oSlide As PowerPoint.Slide)
Dim sh As Shape
For Each sh In oSlide.Shapes
If sh.HasTextFrame Then
If UCase(sh.TextFrame2.TextRange.Text) = "LOGO" Then
oSlide.Select
DoEvents: DoEvents
shLogo.Copy
With oSlide.Shapes.Paste
.LockAspectRatio = msoFalse
.Left = sh.Left
.Top = sh.Top - ((.Height - sh.Height) / 2)
.AlternativeText = "LogoMacro"
sh.TextFrame2.TextRange.Font.Fill.ForeColor.RGB = RGB(255, 255, 255)
End With
Exit For
End If
End If
Next
End Sub
Below ist die Fehlermeldung, die ich auf Powerpoint 2016 erhalte: