Results 1 to 2 of 2

Thread: VBA Code to convert outlook mail to PDF

  1. #1
    Seeker Mahesh Babu's Avatar
    Join Date
    Nov 2012
    Hyderabad, Andhra Pradesh, India

    VBA Code to convert outlook mail to PDF

    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi Experts,

    I have a VBA script convert an email to PDF. But am getting the below Debug error.

    Please help me out in resolving the error.

    'Save as pdf
    wrdApp.ActiveDocument.ExportAsFixedFormat OutputFileName:= _
    strCurrentFile, ExportFormat:= _
    wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:= _
    wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=0, To:=0, _
    Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
    CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
    BitmapMissingFonts:=True, UseISO19005_1:=False

    Attached is the The Code
    Attached Files Attached Files

  2. #2
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Nanaimo, BC, Canada
    Blog Entries
    Excel Version
    Excel Office 365 Insider
    What version of Outlook are you using?

    Try shortening it to:
    wrdApp.ActiveDocument.ExportAsFixedFormat OutputFileName:=strCurrentFile, ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False
    Ken Puls, FCPA, FCMA, MS MVP

    Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training), with my book M is for Data Monkey, or our new Power Query Recipe cards!

    Main Site: -||- Blog: -||- Forums:
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts