Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
tcek tcek is offline
external usenet poster
 
Posts: 3
Default Mail merge macro not adding MS Access query data to form

I have a batch file that loads a Word document and then runs a macro that
inserts MS query results into a standard form letter. The batch file will
run and load everything but the data does not appear in the printed output.
the batch file and macro appear below

Batch file to open document, print the form letter and close Word:

C:\Program Files\Microsoft Office\Office\WINWord.exe"
p:\private\TC\CLINSRV\AccessPrograms\EPOMonitoring Page1.doc
/mEPOMonitoringForm /mfileprintdefault /mpausemacroafterprinting /mfileexit
exit

Macro to insert MS query data:

Sub EPOMonitoringForm()
'
' EPOMonitoringForm Macro
' Macro recorded 8/22/2007 by TC,
'
ChangeFileOpenDirectory "P:\private\TC\CLINSRV\AccessPrograms\"
Documents.Open FileName:="EPOMonitoringPage1.doc", ConfirmConversions:= _
False, ReadOnly:=False, AddToRecentFiles:=False,
PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
With ActiveDocument.MailMerge
.Destination = wdSendToPrinter
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = False
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
With Dialogs(wdDialogFilePrint)
.Execute
End With

End With
End With
End Sub


  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Mail merge macro not adding MS Access query data to form

The chances are that you need to apply the registry patch described in the
following article:

http://support.microsoft.com/kb/825765

--
Peter Jamieson
http://tips.pjmsn.me.uk

"tcek" wrote in message
...
I have a batch file that loads a Word document and then runs a macro that
inserts MS query results into a standard form letter. The batch file
will
run and load everything but the data does not appear in the printed
output.
the batch file and macro appear below

Batch file to open document, print the form letter and close Word:

C:\Program Files\Microsoft Office\Office\WINWord.exe"
p:\private\TC\CLINSRV\AccessPrograms\EPOMonitoring Page1.doc
/mEPOMonitoringForm /mfileprintdefault /mpausemacroafterprinting
/mfileexit
exit

Macro to insert MS query data:

Sub EPOMonitoringForm()
'
' EPOMonitoringForm Macro
' Macro recorded 8/22/2007 by TC,
'
ChangeFileOpenDirectory "P:\private\TC\CLINSRV\AccessPrograms\"
Documents.Open FileName:="EPOMonitoringPage1.doc", ConfirmConversions:=
_
False, ReadOnly:=False, AddToRecentFiles:=False,
PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
With ActiveDocument.MailMerge
.Destination = wdSendToPrinter
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = False
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
With Dialogs(wdDialogFilePrint)
.Execute
End With

End With
End With
End Sub



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
Mail merge on an access query... Warrio Mailmerge 2 September 16th 06 12:49 AM
Word 2003 Merge won't show data in Access Query? Philip Mailmerge 2 June 7th 06 05:14 PM
Mail Merge From Access Query hspgapsemc Mailmerge 1 May 21st 06 07:07 AM
Mail merge with Access DB does not see a query SarahB Mailmerge 8 November 29th 05 07:18 PM
Mail Merge from Access Query KelMon Mailmerge 1 March 1st 05 01:52 AM


All times are GMT +1. The time now is 08:48 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"