VBA Word

S

Scottmk

Hi, This is from a userform that I have in word, but I don't think th
problem is really related to word as much as it is with how the cod
reads:

With ActiveDocument
.Bookmarks("Text1").Range_
.InsertBefore Textbox1
.Bookmarks("Text2").Range_
.InsertBefore Textbox2
End With

Userform1.Hide

(The Beginning and the ends are there as well, I just didn't typ
them)

I am trying to create a Userform for a document template. I woul
really appreciate it if someone could go t
http://word.mvps.org/FAQs/Userforms/CreateAUserFormContent.htm
This only took me <5 minutes to go through their tutorial, but
couldn't get it to work. It didn't like the .Range_ part.
Thanks,
Scot
 
E

Ed

You're missing a couple of things, Scott:
(1) This is an *Excel* VBA group. VBA is similar, but the object models
are significantly different. You might want to take Word issues to
microsoft.public.word.vba.beginners.
(2) There are supposed to be periods in front of Bookmarks and InsertBefore
at each instance.
(3) There is a space between Range and _ in each instance.
You also might want to go through the tutorial again, this time a bit
slower. I've been fumbling my way through VBA for a little over a year now,
and I have become very aware that good coding is a whole lot more than
cut-and-paste. It's really hard to do something well when you don't
understand it.

Ed
 
J

JE McGimpsey

Nonetheless, you'd be better off posting to the

microsoft.public.word.vba.beginners

newsgroup.
 
S

Scottmk

Thanks guys..I know, I've been trying to join those other groups bu
still waiting for activation. In the meantime I was able to figur
out my problem.
Thanks,
Scot
 
T

Tom Ogilvy

news://msnews.microsoft.com/microsoft.public.word.vba.beginners

No activation is required.
 

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