我一直在使用下面的宏拉出的项目在括号意见中的话:
'
' CommentBubble Macro
'
'
Dim myRange As Range
Set myRange = ActiveDocument.Content
searchtext = "\(*\)"
With myRange.Find
.MatchWildcards = True
Do While .Execute(findText:=searchtext, Forward:=True) = True
If Len(myRange.Text) > 4 Then
ActiveDocument.Comments.Add myRange, myRange.Text
myRange.Text = ""
End If
Loop
End With
End Sub
其原因我已经长度的案文是>4是因为这些法律文件,我不想要隔离弦,有东西像"在以下情况:(i)1的条件,(ii)的条件2,等等。"
然而,这一段的文本的上述码休息:
This is sample text (with some additional text) that does stuff (with more stuff) and represents 39.4% of shares on the effective date (before giving effect, with some conditions such as ( some stuff (i) and some stuff (ii) with final stuff) and more final stuff) which is subject to (some conditions here) and conclude here.
如果你跑这样你会得到以下结果:
This is sample text that does stuff and represents 39.4% of shares on the effective date and some stuff (ii) with final stuff) and more final stuff) which is subject to and conclude here.
正如你可以看到的嵌套括号引起一些麻烦。 任何建议?
谢谢!