我有以下代码:
Sub WriteTextBox()
Dim i As Integer
Dim pptcount As Integer
Dim tb As Shape
Dim sld As Slide
Dim pres As Presentation
Dim var1 As String
var1 = InputBox("Vul hier de maand in")
var2 = "Maand: "
var3 = var2 + var1
pptcount = Application.Presentations.Count
For i = 1 To pptcount
Set pres = Application.Presentations(i)
Set sld = pres.Slides(1)
Set tb = sld.Shapes.AddTextbox(msoTextOrientationHorizontal, 600, 50, 100, 50)
tb.TextFrame.TextRange.Text = var3
tb.Line.Visible = True
Next
End Sub通过它,我可以在powerpoint文件中放置一个新的文本形状。我还想更改对象中的其他内容(比如字体大小),但当输入时:
tb.TextFrame.TextEffect.FontBold = true我犯了个错误。
有人知道我怎样才能在文本框中添加额外的功能吗?还尝试使用With和End With语句,但随后它不识别我的对象:
With tb.TextFrame.TextRange
.TextEffect.FontBold = true
End With发布于 2014-02-04 09:46:43
tb.TextFrame没有TextEffect属性。试一试:
tb.TextEffect.FontBold = msoTrue编辑以上工作在PowerPoint 2010。
以下是PowerPoint 2003的内容:
tb.TextFrame.TextRange.Font.Bold = msoTrue https://stackoverflow.com/questions/21548424
复制相似问题