【发布时间】:2016-08-20 06:15:10
【问题描述】:
我想找一些text 如果此文本在表格中,则将表格转换为文本,否则什么也不做
但是当没有Table 时,它会给出Error
Selection.Find.ClearFormatting
With Selection.Find
.Text = " - ^$^$^$^$ ^$ - ^$^$^$^$^$^$"
.Forward = True
.Wrap = wdFindStop
.Format = True
End With
Selection.Find.Execute
If Selection.Find.Found = True Then
Selection.Tables(1).Select ' This is Error position
Selection.Rows.ConvertToText Separator:=wdSeparateByTabs, NestedTables:= _
True
Else
End If
我希望它在 loop 中 do 它
【问题讨论】:
-
if selection.tables.count>-0 then..... for I =1 to selection.tables.count ....
标签: vba ms-word word-2007 word-2003