Am fost folosind următoarele macro pentru a scoate elemente din paranteză la comentarii în word:
'
' 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
Motivul pentru care am avea lungimea de text să fie de > 4 este pentru că acestea sunt acte juridice și nu vreau să izoleze siruri de caractere care au lucruri de genul "în următoarele condiții: (i) starea 1, (ii) condiția 2, etc."
Cu toate acestea, aici este un fragment de text pentru care codul de mai sus pauze:
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.
Dacă tu a alerga acest lucru, veți obține următorul rezultat:
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.
După cum puteți vedea paranteze imbricate cauza unele probleme. Vreun sfat?
Multumesc!!!