word doc that will send a request

W

WP

Hi all
I am trying to create a word doc that will send certain info to a user.
The document will be used for literature requests for sales people
In this document i would like a drop down so they can pick thier name,
product asking for, division and then a 2 calanders. I see in the vba side of
word you can add a form to the doc and I have added a combo box, but i cant
find out where to store the data that the drop downs will draw from. Any help
or direction to a good site would be greatly appreciated
TIA
WP
 
J

Jean-Guy Marcil

WP was telling us:
WP nous racontait que :
Hi all
I am trying to create a word doc that will send certain info to a
user.
The document will be used for literature requests for sales people
In this document i would like a drop down so they can pick thier name,
product asking for, division and then a 2 calanders. I see in the vba
side of word you can add a form to the doc and I have added a combo
box, but i cant find out where to store the data that the drop downs
will draw from. Any help or direction to a good site would be greatly
appreciated
TIA
WP

Have you been to:
http://word.mvps.org/faqs/Userforms/index.htm
???

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
W

WP

Bonjour Jean Guy!
Excellent info on that site
I did what the page said and it looks like it will work great.
I created the form in the vba editor and added the code right i think!
When I open the .dot the form does come up
When i add info to the 1st of the text boxes i get this error

Compile error: method or data not found
I click ok and the debugger comes up with this sub highlighted
Range_ is highlighted in blue ands the private sub in yellow
I tried changing several things and still get the error
HELP!!!!
Thanks

Private Sub TextBox1_Change()
With ActiveDocument
.Bookmarks(UserName).Range_
.InsertBefore TextBox1
End Sub
 
J

Jean-Guy Marcil

WP was telling us:
WP nous racontait que :
Bonjour Jean Guy!
Excellent info on that site
I did what the page said and it looks like it will work great.
I created the form in the vba editor and added the code right i think!
When I open the .dot the form does come up
When i add info to the 1st of the text boxes i get this error

Compile error: method or data not found
I click ok and the debugger comes up with this sub highlighted
Range_ is highlighted in blue ands the private sub in yellow
I tried changing several things and still get the error
HELP!!!!
Thanks

Private Sub TextBox1_Change()
With ActiveDocument
.Bookmarks(UserName).Range_
.InsertBefore TextBox1
End Sub

This is a common error when copying/pasting code from the Internet.

There should be a space before the underscore that comes after Range.

The underscore indicates that a line of code continues down to the next
line, without the underscore it should be one line:
.Bookmarks(UserName).Range.InsertBefore TextBox1
is the same as
.Bookmarks(UserName).Range _
.InsertBefore TextBox1

We use the underscore to make the code easier to read. We normally indent
the second and following lines that have been "underscored". Sometimes, with
variables and parameters, a line of code can be too long too manage on the
screen.

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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