vba - Exporting A3 email from Outlook to PDF -
i have vba script exports incoming emails pdf via word:
'create word object dim wrdapp word.application dim wrddoc word.document set wrdapp = createobject("word.application") set wrddoc = wrdapp.documents.open(filename:=tmpfilename, visible:=true) dim wshshell object dim specialpath string dim strtosaveas string set wshshell = createobject("wscript.shell") mydocs = "\\my path files\" strtosaveas = mydocs & "\" & sname & ".pdf" wrdapp.activedocument.exportasfixedformat outputfilename:= _ strtosaveas, exportformat:=wdexportformatpdf, _ openafterexport:=false, optimizefor:=wdexportoptimizeforprint, _ range:=wdexportcurrentpage, item:= _ wdexportdocumentcontent, includedocprops:=true, keepirm:=true, _ createbookmarks:=wdexportcreatenobookmarks, docstructuretags:=true, _ bitmapmissingfonts:=true, useiso19005_1:=false
it works fine, i've noticed emails trimmed on right side - after investigation i've found wide a4 page - in fact a3!
unfortunately can't see page size anywhere within document.exportasfixedformat method. there way either shrink email a4 or resize pdf a3?
adding
wrdapp.activedocument.pagesetup.papersize = wdpapersize.wdpapera3
resizes print page a3. have find way figure out how determine appropriate page size emails (if doesn't fit a4 use a3)
Comments
Post a Comment