I am trying to setup a User Form as outlined at
http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
My bookmarks & fields are named
corpname
corpadd1
attention
yearend
retainer
My VBA code for the Command Button is as follows:
Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks("corpname").Range_
.InsertBefore corpname
.Bookmarks("corpadd1").Range_
.InsertBefore corpadd1
.Bookmarks("attention").Range_
.InsertBefore attention
.Bookmarks("yearend").Range_
.InsertBefore yearend
.Bookmarks("retainer").Range_
.InsertBefore retainer
End With
UserForm1.Hide
End Sub
When I run the template, I get a compile error when I hit the command
button, after filling in the Userform.
I keep reviewing the instructions, but can't find where I messed up.
Any help appreciated
TIA
Doug
Jay Freedman - 28 Apr 2006 23:04 GMT
In each place where you have
Range_
insert a space between the e and the underscore.
For an explanation, see
http://www.word.mvps.org/FAQs/MacrosVBA/_AtEndOfLine.htm.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
>I am trying to setup a User Form as outlined at
>http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
[quoted text clipped - 35 lines]
>TIA
>Doug