Method or Data Member not found HELP

G

Guest

Private Sub CommandButton1_Click()

With ActiveDocument
.Bookmarks("Text1").Range_
.InsertBefore TextBox1
.Bookmarks("Text2").Range_
.InsertBefore TextBox2
End With

UserForm1.Hide

End Sub

Why am i getting this error? Method or Data Memeber not found
Also I need to create a drop down that will have 4 choices, upon these four
choices i need to populate an address in the letter? Should I code the addys
in code or external data source??? Please Help and thanks!
 
J

Jay Freedman

In two places you must insert a space between the word Range and the
following underscore. See
http://www.word.mvps.org/FAQs/MacrosVBA/_AtEndOfLine.htm for an explanation.

If the dropdown needs only four entries, and they won't change frequently,
then just include them in the code (in the Initialize_UserForm procedure).
Also, if the template or document containing the UserForm will be sent to
other users, avoid external data files.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top