Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2006

Tip: Looking for answers? Try searching our database.

User forms, Word 2000, macro error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dmk - 28 Sep 2006 16:53 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.