Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Grant B Grant B is offline
external usenet poster
 
Posts: 1
Default Pull fields from one contact record into Word

I would like to have Word templates that would auto fill from Outlook. For
example, when I have "Bill Smith" contact open (or selected or whatever),
opening a template would fillin the name "Bill Smith." I want to do these one
at a time, not an entire mailmerge. Any suggestions?
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Pull fields from one contact record into Word

Outlook's Tools Mailmerge will do that see
http://www.gmayor.com/mailmerge_from_outlook.htm
or see http://www.gmayor.com/Macrobutton.htm for a method of calling data
from Outlook whilst working in Word.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Grant B wrote:
I would like to have Word templates that would auto fill from
Outlook. For example, when I have "Bill Smith" contact open (or
selected or whatever), opening a template would fillin the name "Bill
Smith." I want to do these one at a time, not an entire mailmerge.
Any suggestions?



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Grant B[_2_] Grant B[_2_] is offline
external usenet poster
 
Posts: 2
Default Pull fields from one contact record into Word

I'm familiar with Mailmerge. What I'm really looking for is the capability I
had in Goldmine of creating documents that would pull from the open contact.
For example, having a "new letter" template (or document) that, when opened,
would automatically enter the name, address, and "Dear" from Outlook. Just
one document, one contact at a time. I'm surprised that I have not been able
to find a way to do that.

Any other ideas... anyone?

Thanks,
Grant

"Graham Mayor" wrote:

Outlook's Tools Mailmerge will do that see
http://www.gmayor.com/mailmerge_from_outlook.htm
or see http://www.gmayor.com/Macrobutton.htm for a method of calling data
from Outlook whilst working in Word.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Grant B wrote:
I would like to have Word templates that would auto fill from
Outlook. For example, when I have "Bill Smith" contact open (or
selected or whatever), opening a template would fillin the name "Bill
Smith." I want to do these one at a time, not an entire mailmerge.
Any suggestions?




  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Pull fields from one contact record into Word

The following code runs from Outlook and will populate docvariable fields
for the variables listed in the code that are located in the template with
the data from the selected Outlook contact:

Dim objitem As Object
Dim cFullName As String
Dim cCompanyName As String
Dim cBusinessAddressStreet As String
Dim cBusinessAddressCity As String
Dim cBusinessAddressState As String
Dim cBusinessAddressZip As String
Dim oWord As Word.Application
Dim WordNotRunning As Boolean
Dim oDoc As Document
Set objitem = GetCurrentItem()
If objitem.Class = olContact Then
With objitem
cFullName = .FullName
cCompanyName = .CompanyName
cBusinessAddressStreet = .BusinessAddressStreet
cBusinessAddressCity = .BusinessAddressCity
cBusinessAddressState = .BusinessAddressState
cBusinessAddressZip = .BusinessAddressPostalCode
End With
End If
On Error Resume Next
Set oWord = GetObject(, "Word.Application")
If Err Then 'Word was not running
Set oWord = New Word.Application
WordNotRunning = True
End If

Set oDoc = oWord.Documents.Add("TemplateName.dot")
oWord.Visible = True
oWord.Activate
With oDoc
.Variables("varFullName").Value = cFullName
If cCompanyName "" Then
.Variables("varCompanyName").Value = cCompanyName
Else
.Variables("varCompanyName").Value = " "
End If
If cBusinessAddressStreet "" Then
.Variables("varStreet").Value = cBusinessAddressStreet
Else
.Variables("varStreet").Value = " "
End If
If cBusinessAddressCity "" Then
.Variables("varCityStateZip").Value = cBusinessAddressCity & ", " &
cBusinessAddressState & " " & cBusinessAddressZip
Else
.Variables("varCityStateZip").Value = " "
End If
.Range.Fields.Update
End With
If WordNotRunning Then
oWord.Documents.Close wdDoNotSaveChanges
oWord.Quit
End If
Set oWord = Nothing
Set olabel = Nothing

--
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

"Grant B" wrote in message
...
I'm familiar with Mailmerge. What I'm really looking for is the capability
I
had in Goldmine of creating documents that would pull from the open
contact.
For example, having a "new letter" template (or document) that, when
opened,
would automatically enter the name, address, and "Dear" from Outlook. Just
one document, one contact at a time. I'm surprised that I have not been
able
to find a way to do that.

Any other ideas... anyone?

Thanks,
Grant

"Graham Mayor" wrote:

Outlook's Tools Mailmerge will do that see
http://www.gmayor.com/mailmerge_from_outlook.htm
or see http://www.gmayor.com/Macrobutton.htm for a method of calling data
from Outlook whilst working in Word.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Grant B wrote:
I would like to have Word templates that would auto fill from
Outlook. For example, when I have "Bill Smith" contact open (or
selected or whatever), opening a template would fillin the name "Bill
Smith." I want to do these one at a time, not an entire mailmerge.
Any suggestions?






  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Grant B[_2_] Grant B[_2_] is offline
external usenet poster
 
Posts: 2
Default Pull fields from one contact record into Word

Sweet, Doug. I think I'm getting closer, but you went a little over my head.
I'm not sure how to get the code into Outlook.

It looks like I'd build a Word template and reference the Outlook fields I
need, then get Outlook to open the template and fill with my data.

Can you explain how to get it into Outlook or should we explore the "paid
consultant" idea?

"Doug Robbins - Word MVP" wrote:

The following code runs from Outlook and will populate docvariable fields
for the variables listed in the code that are located in the template with
the data from the selected Outlook contact:

Dim objitem As Object
Dim cFullName As String
Dim cCompanyName As String
Dim cBusinessAddressStreet As String
Dim cBusinessAddressCity As String
Dim cBusinessAddressState As String
Dim cBusinessAddressZip As String
Dim oWord As Word.Application
Dim WordNotRunning As Boolean
Dim oDoc As Document
Set objitem = GetCurrentItem()
If objitem.Class = olContact Then
With objitem
cFullName = .FullName
cCompanyName = .CompanyName
cBusinessAddressStreet = .BusinessAddressStreet
cBusinessAddressCity = .BusinessAddressCity
cBusinessAddressState = .BusinessAddressState
cBusinessAddressZip = .BusinessAddressPostalCode
End With
End If
On Error Resume Next
Set oWord = GetObject(, "Word.Application")
If Err Then 'Word was not running
Set oWord = New Word.Application
WordNotRunning = True
End If

Set oDoc = oWord.Documents.Add("TemplateName.dot")
oWord.Visible = True
oWord.Activate
With oDoc
.Variables("varFullName").Value = cFullName
If cCompanyName "" Then
.Variables("varCompanyName").Value = cCompanyName
Else
.Variables("varCompanyName").Value = " "
End If
If cBusinessAddressStreet "" Then
.Variables("varStreet").Value = cBusinessAddressStreet
Else
.Variables("varStreet").Value = " "
End If
If cBusinessAddressCity "" Then
.Variables("varCityStateZip").Value = cBusinessAddressCity & ", " &
cBusinessAddressState & " " & cBusinessAddressZip
Else
.Variables("varCityStateZip").Value = " "
End If
.Range.Fields.Update
End With
If WordNotRunning Then
oWord.Documents.Close wdDoNotSaveChanges
oWord.Quit
End If
Set oWord = Nothing
Set olabel = Nothing

--
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

"Grant B" wrote in message
...
I'm familiar with Mailmerge. What I'm really looking for is the capability
I
had in Goldmine of creating documents that would pull from the open
contact.
For example, having a "new letter" template (or document) that, when
opened,
would automatically enter the name, address, and "Dear" from Outlook. Just
one document, one contact at a time. I'm surprised that I have not been
able
to find a way to do that.

Any other ideas... anyone?

Thanks,
Grant

"Graham Mayor" wrote:

Outlook's Tools Mailmerge will do that see
http://www.gmayor.com/mailmerge_from_outlook.htm
or see http://www.gmayor.com/Macrobutton.htm for a method of calling data
from Outlook whilst working in Word.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Grant B wrote:
I would like to have Word templates that would auto fill from
Outlook. For example, when I have "Bill Smith" contact open (or
selected or whatever), opening a template would fillin the name "Bill
Smith." I want to do these one at a time, not an entire mailmerge.
Any suggestions?








  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Pull fields from one contact record into Word

The method is very similar to that described in the article "What do I do
with macros sent to me by other newsgroup readers to help me out?" at:

http://www.word.mvps.org/FAQs/Macros...eateAMacro.htm

except that from the Tools menu in Outlook, you select Macro and then
Macros. In the case of Outlook however, there is no option to choose a
template in which to create the macros.


--
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

"Grant B" wrote in message
...
Sweet, Doug. I think I'm getting closer, but you went a little over my
head.
I'm not sure how to get the code into Outlook.

It looks like I'd build a Word template and reference the Outlook fields I
need, then get Outlook to open the template and fill with my data.

Can you explain how to get it into Outlook or should we explore the "paid
consultant" idea?

"Doug Robbins - Word MVP" wrote:

The following code runs from Outlook and will populate docvariable fields
for the variables listed in the code that are located in the template
with
the data from the selected Outlook contact:

Dim objitem As Object
Dim cFullName As String
Dim cCompanyName As String
Dim cBusinessAddressStreet As String
Dim cBusinessAddressCity As String
Dim cBusinessAddressState As String
Dim cBusinessAddressZip As String
Dim oWord As Word.Application
Dim WordNotRunning As Boolean
Dim oDoc As Document
Set objitem = GetCurrentItem()
If objitem.Class = olContact Then
With objitem
cFullName = .FullName
cCompanyName = .CompanyName
cBusinessAddressStreet = .BusinessAddressStreet
cBusinessAddressCity = .BusinessAddressCity
cBusinessAddressState = .BusinessAddressState
cBusinessAddressZip = .BusinessAddressPostalCode
End With
End If
On Error Resume Next
Set oWord = GetObject(, "Word.Application")
If Err Then 'Word was not running
Set oWord = New Word.Application
WordNotRunning = True
End If

Set oDoc = oWord.Documents.Add("TemplateName.dot")
oWord.Visible = True
oWord.Activate
With oDoc
.Variables("varFullName").Value = cFullName
If cCompanyName "" Then
.Variables("varCompanyName").Value = cCompanyName
Else
.Variables("varCompanyName").Value = " "
End If
If cBusinessAddressStreet "" Then
.Variables("varStreet").Value = cBusinessAddressStreet
Else
.Variables("varStreet").Value = " "
End If
If cBusinessAddressCity "" Then
.Variables("varCityStateZip").Value = cBusinessAddressCity & ", "
&
cBusinessAddressState & " " & cBusinessAddressZip
Else
.Variables("varCityStateZip").Value = " "
End If
.Range.Fields.Update
End With
If WordNotRunning Then
oWord.Documents.Close wdDoNotSaveChanges
oWord.Quit
End If
Set oWord = Nothing
Set olabel = Nothing

--
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

"Grant B" wrote in message
...
I'm familiar with Mailmerge. What I'm really looking for is the
capability
I
had in Goldmine of creating documents that would pull from the open
contact.
For example, having a "new letter" template (or document) that, when
opened,
would automatically enter the name, address, and "Dear" from Outlook.
Just
one document, one contact at a time. I'm surprised that I have not been
able
to find a way to do that.

Any other ideas... anyone?

Thanks,
Grant

"Graham Mayor" wrote:

Outlook's Tools Mailmerge will do that see
http://www.gmayor.com/mailmerge_from_outlook.htm
or see http://www.gmayor.com/Macrobutton.htm for a method of calling
data
from Outlook whilst working in Word.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Grant B wrote:
I would like to have Word templates that would auto fill from
Outlook. For example, when I have "Bill Smith" contact open (or
selected or whatever), opening a template would fillin the name
"Bill
Smith." I want to do these one at a time, not an entire mailmerge.
Any suggestions?








Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing Contact List With Fields of Choice Windancer Microsoft Word Help 2 May 8th 08 01:08 PM
Contact fields inserted in a Word document Estimator Microsoft Word Help 2 December 30th 06 06:28 AM
Record 1 contains too few data fields KingKaos Mailmerge 4 July 6th 06 07:48 AM
record 16 contained too few data fields error on word 2003 from cs Deanjr Mailmerge 3 March 6th 06 03:10 PM
Create 5x8 contact card with fields to import from Access. Bluie2407 Microsoft Word Help 1 July 9th 05 06:36 AM


All times are GMT +1. The time now is 03:43 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"