Thread: VBA Word
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ed[_18_] Ed[_18_] is offline
external usenet poster
 
Posts: 118
Default VBA Word

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

"Scottmk " wrote in message
...
Hi, This is from a userform that I have in word, but I don't think the
problem is really related to word as much as it is with how the code
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 type
them)

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


---
Message posted from http://www.ExcelForum.com/