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
    Location
    Hyderabad, Andhra Pradesh, India
    Posts
    7
    Articles
    0

    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
    Location
    Nanaimo, BC, Canada
    Posts
    2,225
    Articles
    57
    Blog Entries
    14
    Excel Version
    Excel Office 365 Insider
    What version of Outlook are you using?

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

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

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/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
  •