prefilled templates 
Author Message
 prefilled templates

I am going to create some templates in Word2000. I want
the templates be prefilled with some userinformation e.g.
phone, initials, e-mail, name and a few others.  

I am aware of the fields UserInitials, UserName and
UserAdress but I need a few more to solve the problem this
way around.

I would appreciate any suggestions.

Thank you!
Kaj



Sun, 01 Jan 2006 22:00:29 GMT  
 prefilled templates
Hi Kaj,

If you use procedures such as the following in an autonew macro in the
templates, it will check for the presence of the data for the user defined
under Tools>Options>User Information.  If it exists, you can obtain it with
the System.PrivateProfileString.   If it doesn't exist, an inputbox will be
displayed asking the user to enter the information.  That will only happen
once for each user/machine combination as the data that is entered will be
stored in the Settings.txt file so that it is available on the next occasion
that the template is used.

Dim Username As String, phone As String
Username = Application.Username
 phone = System.PrivateProfileString("C:\Settings.Txt", _
Username, "phone")
If phone = "" Then
    System.PrivateProfileString("C:\Settings.Txt", Username, "phone") =
InputBox("Please enter your phone number", "Phone")
Else
    MsgBox System.PrivateProfileString("C:\Settings.Txt", _
Username, "phone")
End If

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested.  Unsolicited questions forwarded
directly to me will only be answered on a consulting basis.

Hope this helps
Doug Robbins - Word MVP

Quote:
> I am going to create some templates in Word2000. I want
> the templates be prefilled with some userinformation e.g.
> phone, initials, e-mail, name and a few others.

> I am aware of the fields UserInitials, UserName and
> UserAdress but I need a few more to solve the problem this
> way around.

> I would appreciate any suggestions.

> Thank you!
> Kaj



Mon, 02 Jan 2006 08:48:28 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Template Templates!

2. Is it possible to trigger an event when a template is loaded as a global template

3. Copying a menu from template to template

4. Refering to Functions and Subs held in one global template from another global template

5. Shared Templates\ Update templates?

6. Reference a sub in a template from another template?

7. Reference a sub in a template from another template?

8. Word 97: How to base NEW DOC on TEMPLATE *NOT* in 'Templates' folder???

9. Document based on a template saving as a template... Please help

10. Doc From Form Template Insists On Saving Changes To Template?

11. Opening a word template

12. exporting data to a word template

 

 
Powered by phpBB® Forum Software