Open the VB Editor and step through the code 1 instruction at a time.
Where is the error occuring (what line of code)?
For a bit more on a userform, see:
http://gregmaxey.mvps.org/Validate_UserForm_TextEntry.htm
Diana Morrison - 19 May 2006 21:43 GMT
it happens on the first line of code
.bookmarks("Text1").Range_
> Open the VB Editor and step through the code 1 instruction at a time.
> Where is the error occuring (what line of code)?
>
> For a bit more on a userform, see:
> http://gregmaxey.mvps.org/Validate_UserForm_TextEntry.htm
Greg Maxey - 19 May 2006 22:01 GMT
Ah,
Pull the lines together to eliminate the underscore:
.Bookmarks("Text1").Range.InsertBefore TextBox1
and
.Bookmarks("Text2").Range.InsertBefore TextBox2

Signature
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
> it happens on the first line of code
>
[quoted text clipped - 5 lines]
>> For a bit more on a userform, see:
>> http://gregmaxey.mvps.org/Validate_UserForm_TextEntry.htm
The probable reason, if you retyped the code instead of using cut&paste, is
that you didn't put in the space before the underscore at the ends of the
lines in
.Bookmarks("Text1").Range _
.InsertBefore TextBox1
.Bookmarks("Text2").Range _
.InsertBefore TextBox2
Because of the font of the web page, those spaces are hard to see, but VBA
requires them.
For an explanation of the underscores, see
http://word.mvps.org/FAQs/MacrosVBA/_AtEndOfLine.htm.

Signature
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 having trouble with an error message: Compile error: method or
> data not found (followed "How to create a Userform" by Doug Robbins).
> So, I created a test document following the exact instructions in the
> same article and I still get the same message. Can you help?
Diana Morrison - 23 May 2006 16:32 GMT
You're right - worked instantly! Thanks so much.
Any recommended reading on this subject? I'd like to be able to better
understand and work with vba for Word.
Thanks!
Diana
> The probable reason, if you retyped the code instead of using cut&paste, is
> that you didn't put in the space before the underscore at the ends of the
[quoted text clipped - 15 lines]
> > So, I created a test document following the exact instructions in the
> > same article and I still get the same message. Can you help?
Jay Freedman - 24 May 2006 04:42 GMT
Glad I could help.
For reading, start at
http://www.word.mvps.org/FAQs/MacrosVBA/VBABasicsIn15Mins.htm and then
read anything else at http://word.mvps.org/FAQs/MacrosVBA/index.htm
and http://word.mvps.org/FAQs/Userforms/index.htm that looks
interesting.
Then go look at the articles and books listed at
http://word.mvps.org/Tutorials/index.htm and
http://word.mvps.org/Tutorials/FreeToAccess.htm.
Of course, if you still have questions, ask them here!
--
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.
>You're right - worked instantly! Thanks so much.
>
[quoted text clipped - 23 lines]
>> > So, I created a test document following the exact instructions in the
>> > same article and I still get the same message. Can you help?