E
ewout.boter
Some time ago, people in this newgroup have helped me out regarding a
problem with a Word macro. Now, I have another question...
The code of the macro is as follows:
Sub InsurancePolicy()
'
' InsurancePolicy Macro
' Macro recorded 9/9/2008 by Boter
'
Dim maindoc As Document
Set maindoc = Documents.Open(FileName:="\\ainl6f001\inf$\data
\Development\InsurancePolicy\InsurancePolicyTemplate.doc",
ReadOnly:=True, Visible:=False)
With maindoc.MailMerge
.Destination = wdSendToNewDocument
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
maindoc.Close wdDoNotSaveChanges
End Sub
The location and the name of the template document are fixed. This is
no problem. However, the name of the file containing the data to be
merged will not be fixed. Therefore, I would like to pass this name
into the macro in some way.
Maybe I should point that Word will be started automatically from a
program on an iSeries (f.k.a. AS/400) server, using the command
STRPCCMD PCCMD('"C:\Program Files\Microsoft Office\Office
\WINWORD.exe" /mInsurancePolicy').
Is there a way to specify a parameter in the previous command? Or is
there some other way to accomplish what I want?
Thanks in advance.
Ewout
problem with a Word macro. Now, I have another question...
The code of the macro is as follows:
Sub InsurancePolicy()
'
' InsurancePolicy Macro
' Macro recorded 9/9/2008 by Boter
'
Dim maindoc As Document
Set maindoc = Documents.Open(FileName:="\\ainl6f001\inf$\data
\Development\InsurancePolicy\InsurancePolicyTemplate.doc",
ReadOnly:=True, Visible:=False)
With maindoc.MailMerge
.Destination = wdSendToNewDocument
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=True
End With
maindoc.Close wdDoNotSaveChanges
End Sub
The location and the name of the template document are fixed. This is
no problem. However, the name of the file containing the data to be
merged will not be fixed. Therefore, I would like to pass this name
into the macro in some way.
Maybe I should point that Word will be started automatically from a
program on an iSeries (f.k.a. AS/400) server, using the command
STRPCCMD PCCMD('"C:\Program Files\Microsoft Office\Office
\WINWORD.exe" /mInsurancePolicy').
Is there a way to specify a parameter in the previous command? Or is
there some other way to accomplish what I want?
Thanks in advance.
Ewout