I am experimenting with "creating a template that contains an autonew macro
which will cause a Userform to be displayed, into which you can enter some
information that you want to appear in the document."
This is the code provided by a MVP in the newsgroup:
Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks("Text1").Range_
.InsertBefore TextBox1
.Bookmarks("Text2").Range_
.InsertBefore TextBox2
End With
UserForm1.Hide
End Sub
Okay, I cannot compile the template because I get an error: "Method or data
member not found" and "Range_" is highlighted in the code. What do I need to
do to fix it? Thanks.
Jay Freedman - 29 Sep 2006 02:12 GMT
You're missing the space that *must* be placed between the word Range
and the following underscore in each case. See
http://www.word.mvps.org/FAQs/MacrosVBA/_AtEndOfLine.htm for
explanation.
--
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 experimenting with "creating a template that contains an autonew macro
>which will cause a Userform to be displayed, into which you can enter some
[quoted text clipped - 15 lines]
>member not found" and "Range_" is highlighted in the code. What do I need to
>do to fix it? Thanks.