How ActiveX control (userForm) access aditional data in word

D

dariusli

I want to design a userForm (or ActiveX control) to get information from
user, such as customer's name, address, title, birthdate,picture and so on,
and I will use the same userForm several times.

For example: the user input his customers' information: name,
gender,birthdate, address,title, picture and so on. Maybe there are nine
customers.
The word document shows only customers' name, gender,birthdate and address.

How can i implement it? Can i design the userForm once and use it serveral
times?
 
P

Pesach Shelnitz

Hi,

Before you start learning about user forms, I think that it is important to
understand that a user form can be distributed as a doc (docx) file or as a
template (dot or dotm). When you distribute a user form as a doc file to
multiple users, each user fills in a copy of the form and saves it with the
same name or a modified name. No macros are needed in this case. On the other
hand, a template can have a macro that runs automatically when the user
creates a new doc based on it. This opens up possibilities for greatly
enriching the form created. The user then saves the file created with a
user-defined name. When you use a template, one of the things that you can do
is have an automatically displayed dialog box (or boxes), in which the user
fills in the information requested.

In your case, since each user will be using the form many times, it seems to
me that using a template would be better. The user would create a new Word
file for each customer using the template and save each file with a unique
name. You can also have code in the template store the data for all of the
user's customers locally in an Excel spreadsheet or in a database, or you can
store all of the data from all of your users centrally through a network.

For lots of details, see
http://www.uwc.edu/training/wlwarchive/Creating_Forms_using_Microsoft_Word.doc,
http://gregmaxey.mvps.org/Create_and_employ_a_UserForm.htm, and
http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm .

For a series of step-by-step tutorials, see
Please Fill Out This Form, Part 1:
http://www.computorcompanion.com/LPMArticle.asp?ID=22 .
Please Fill Out This Form, Part 2:
http://www.computorcompanion.com/LPMArticle.asp?ID=46
Please Fill Out This Form, Part 3:
http://www.computorcompanion.com/LPMArticle.asp?ID=119
Please Fill Out This Form, Part 4:
http://www.computorcompanion.com/LPMArticle.asp?ID=127
Please Fill Out This Form, Part 5:
http://www.computorcompanion.com/LPMArticle.asp?ID=136
 
D

dariusli

Thank you, Mr Pesach! Your Reply is very valuable, but my problem is that: I
have to save some entities into a document and the userform give more
information than it shows to the user.
for example:
The userForm may give a window to user to input customer's
Name,gender,birthdate,title,experience,habit and so on. (eg:
Customer1 Male 1977-08-01 Manager, salary: 5000$,...)
And the document shows only some data of the userFom. Here is a table
shows in the documnet.=>
Customer1 Male 1977-08-01 Manager
Customer2 Female 1979-09-21 Employee
Customer3 Female 1960-02-24 Employee

(A good example is :
http://159.226.244.13/miniiris/proposal/NSFCProposal2009.exe, but it is
written in Chinese. I donot know how to implement the function.)
 
D

Doug Robbins - Word MVP

D

dariusli

thank you,Mr Robbins, maybe you misunderstand my question. My problem is that
how to store extra data in word (the extra data is invisible). You see, we
can input customer's name, ssid, etc. in the UserForm, but how can we only
present customer'name in the word document and hide other attribute in the
word document. (I have designed the userform, but i am going to use it nine
times. How can i store the extra data invisibly in the document? )
 
D

Doug Robbins - Word MVP

Store all of the information from the userform as variables in the document
and only display as much of it as you nee by the use of {DOCVARIABLE}
fields.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
W

WANG YX

Store all of the information from the userform as variables in the document
and only display as much of it as you nee by the use of {DOCVARIABLE}
fields.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

It is helpful! Many thanks to all of you!
 

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