Powershell mail merge only prints first page -
i using powershell script mail merge using ms word , code below... merge executes correctly, when use .printout() command, first page printed.
is there anyway can force print of pages completed merge?
thank you.
$word = new-object -comobject "word.application" $word.visible = 1 $doc = $word.documents.open("$psscriptroot\resources\templatefile.docx") $doc.mailmerge.execute() $doc.printout() $quitformat = [enum]::parse([microsoft.office.interop.word.wdsaveoptions],"wddonotsavechanges") $word.quit([ref]$quitformat)
try specifying wdprintoutrange wdprintalldocument
:
$doc.printout( [ref]$false, [ref]$false, [ref][microsoft.office.interop.word.wdprintoutrange]::wdprintalldocument )
Comments
Post a Comment