我一直在用Power Point進行一個小小的黑客工作,以自動創建一個文本框形狀,其中有一些預設效果,其中文本是從剪貼板動態獲取的。我在這裏安靜地解決了一些問題,這些功能可以在下面的帶有宏的VB腳本中正常工作。VBA - Power Point - 以編程方式將文本包裹在Shape中
Sub ReadFromFile()
' CLIPBOARD
Dim MyData As DataObject
Dim strClip As String
' CLIPBOARD
Set MyData = New DataObject
MyData.GetFromClipboard
strClip = MyData.GetText
Set activeDocument = ActivePresentation.Slides(1)
With activeDocument
'Set QASlide = .Slides.Add(Index:=.Slides.Count + 0, Layout:=ppLayoutBlank)
activeDocument.Shapes.AddTextEffect PresetTextEffect:=msoTextEffect28, _
Text:=strClip, _
FontName:="Garde Gothic", FontSize:=44, FontBold:=msoTrue, _
FontItalic:=msoFalse, Left:=25, Top:=25
With .Shapes(.Shapes.Count)
.Width = 200
.Height = 300
End With
End With
End Sub
有人能幫助我在爲包裝具有定義寬度和高度在上面的代碼形狀內的文本腳本?