I have a macro in word, I would like to insert a "(" at the end of the active document then go back to the beginning and run the macro as I have it right now. Can someone help with this?
I am obviously a n00b
Printable View
I have a macro in word, I would like to insert a "(" at the end of the active document then go back to the beginning and run the macro as I have it right now. Can someone help with this?
I am obviously a n00b
I assume you only want to add the opening brace once only? Otherwise you might end up with an infinite loop.
VB Code:
Sub wooonellymacro() 'All you existing code here. '.... 'Add this code With ThisDocument 'Check if the last character is a opening brace If .Characters(.Characters.Count - 1) <> "(" Then 'If not then add one and rerun this procedure .Range.InsertAfter ("(") wooonellymacro End If End With End Sub
Cool thank you very much