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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -