auto personalise group template.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I make a grouptemplate that automaticaly fills in name and other
personal info of the author. all the info of that user is stored in a .txt
document on each users pc (for every user a different .txt document.)
 
You can insert bookmarked texts from a Word Document (text files do not
support bookmarks) using IncludeText fields
If you want to read text from an ini file then you need a text file laid out
in sections like

[InvoiceNumber]
Order=2
[Print Number]
Order=1
[UserName]
Name = "Graham Mayor"
Phone = "99 123456"
Email = (e-mail address removed)

To read (say) the UserName section into a document, you can use a macro
similar to the following, which reads the three entries from the UserName
section and types them into the document. Here the text file is saved as
Settings.ini in the Word Startup folder.

Sub AddDataFromINIFile()
Dim SettingsFile As String
Dim Name As String
Dim EMail As String
Dim Phone As String
SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini"
Name = System.PrivateProfileString(SettingsFile, _
"UserName", "Name")
Phone = System.PrivateProfileString(SettingsFile, _
"UserName", "Phone")
EMail = System.PrivateProfileString(SettingsFile, _
"UserName", "Email")
With Selection
.TypeText Text:=Name
.TypeParagraph
.TypeText Text:=Phone
.TypeParagraph
.TypeText Text:=EMail
End With
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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

Back
Top