【发布时间】:2014-08-26 03:34:20
【问题描述】:
我是 powerpoint 对象模型的新手,想知道为什么下面的 sn-p 代码不起作用。代码的目的是通过一个文本框并用它们的小写等价词替换某些单词。我不确定我是否要正确替换这个词......但我很困惑为什么程序不会“输入”if语句......即使它找到和“of”并且它们都是字符串!
感谢任何帮助! :)
Sub findConjectures()
Dim theWord As TextRange
With ActiveWindow.Selection.ShapeRange(1).TextFrame
For Each theWord In .TextRange.Words
MsgBox CStr(theWord) 'just used this as a test
If CStr(LCase(theWord)) = "of" Then ' this is the part that confuses me!
theWord.Text = LCase(theWord) 'not sure if this is used correctly
End If
Next
End With
End Sub
【问题讨论】:
标签: vba loops powerpoint words