none
Open PDF via Word from Excel macro - Suppress Conversion Message RRS feed

  • Question

  • I am trying to open a PDF in Word 2013 via an Excel macro. My macro is hanging while waiting for the user to respond to the PDF conversion message (Word will now convert your PDF). I would like to suppress this warning, since this is being run from Excel and I'd prefer Word not be visible at all. Here is the code I am using:

    wordApp.DisplayAlerts = False
    Set wordDoc = wordApp.Documents.Open(Filename:=FName, ConfirmConversions:=False)
    wordApp.DisplayAlerts = True
    

    I have tried multiple combinations of DisplayAlerts settings (Application.DisplayAlerts, =wdAlertsNone, setting Word to visible) and I am still getting the conversion message.

    I found another discussion (Open PDF in Word without Conversion Message - sorry can't post links). A similar solution is marked as the answer, but I'm unable to suppress the conversion message.

    Thanks!

    Thursday, July 30, 2015 4:21 AM

All replies

  • The correct syntax would be

    wordApp.DisplayAlerts = 0
    Set wordDoc = wordApp.Documents.Open(Filename:=FName, ConfirmConversions:=False)
    wordApp.DisplayAlerts = -1

    but it won't make any difference to the particular prompt. The checkbox on the prompt must be checked to avoid the issue.

    I would also add code to ensure that wordApp is Word 2013 or later or it will crash.


    Graham Mayor - Word MVP
    www.gmayor.com

    Thursday, July 30, 2015 6:01 AM
  • Ok, thank you!

    This was my last attempt before adding instructions to the process to open a PDF in Word and check that box. Thanks for the clarification.

    Thursday, July 30, 2015 3:41 PM