Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Printing Contact List With Fields of Choice | Microsoft Word Help | |||
Contact fields inserted in a Word document | Microsoft Word Help | |||
Record 1 contains too few data fields | Mailmerge | |||
record 16 contained too few data fields error on word 2003 from cs | Mailmerge | |||
Create 5x8 contact card with fields to import from Access. | Microsoft Word Help |