G
Guest
I have a very simple user box with the following code:
Private Sub CmdOK_Click()
Dim rng As Range
Set rng = ActiveDocument.Bookmarks("ClientNumber").Range
rng.InsertAfter.txtClient
Set rng = ActiveDocument.Bookmarks("MatterNumber").Range
rng.InsertAfter.txtMatter
End Sub
The user simply has to enter a client and matter number
which the macro should place after the appropriate
bookmarks. But when the macro runs I get:
"Argument not optional" and it highlights
the "InsertAfter" command. Not sure what to do. Thanks
for your help.
Private Sub CmdOK_Click()
Dim rng As Range
Set rng = ActiveDocument.Bookmarks("ClientNumber").Range
rng.InsertAfter.txtClient
Set rng = ActiveDocument.Bookmarks("MatterNumber").Range
rng.InsertAfter.txtMatter
End Sub
The user simply has to enter a client and matter number
which the macro should place after the appropriate
bookmarks. But when the macro runs I get:
"Argument not optional" and it highlights
the "InsertAfter" command. Not sure what to do. Thanks
for your help.