none
displayalerts = wdAlertsNone fails to suppress margin warning under winword 2010

    Question

  • Hello,

    we use winword in a automation environment to print documents via the "printto" function.

    Some documents with content outside the printable area of the page results in a message box "The margins of ... are set outside the printable area of the page. Do you want to continue?"

    This is a poor behavior in a automation enviroment and so a colleague of me developed a COM-Add-In to set displayalerts property to false/wdAlertsNone in the "IDTExtensibility2_OnConnection" Event

    This works fine with Winword 2003 and Winword 2007 BUT NOT with Winword 2010

    It's seems the property is not longer global ?

    I found some macros setting DisplayAlerts = wdAlertsNone, printing the actual document and turn on DisplayAlerts again. But how can i call a macro like this with the "printto" command? Any suggestions?

     

    Thank you for your help :-)

    Timm

     

     

     

     

     

     

     

    Monday, November 29, 2010 3:13 PM

Answers

  • Hi Timm

    Word was never designed as an "automation environment". It's always been a user interactive application; the automation capabilities are a "bonus". It's never been possible to suppress ALL messages requiring user response in Word, as it has been with Excel.

    It's unfortunate that something that used to work no longer does. We've been noticing a number of problems with backwards compatibility around things to do with Print in Word 2010 and I suspect this has to do with the way it's been incorporated into the Backstage view. It appears the former built-in command has been superceded by new code and this was not fully incorporated into much of anything that used to work or should work.

    About the only thing you can do is something like what's described in this KB article:

    http://support.microsoft.com/kb/259971


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by TimmHamburg Tuesday, November 30, 2010 9:06 AM
    Monday, November 29, 2010 3:46 PM
    Moderator

All replies

  • Hi Timm

    Word was never designed as an "automation environment". It's always been a user interactive application; the automation capabilities are a "bonus". It's never been possible to suppress ALL messages requiring user response in Word, as it has been with Excel.

    It's unfortunate that something that used to work no longer does. We've been noticing a number of problems with backwards compatibility around things to do with Print in Word 2010 and I suspect this has to do with the way it's been incorporated into the Backstage view. It appears the former built-in command has been superceded by new code and this was not fully incorporated into much of anything that used to work or should work.

    About the only thing you can do is something like what's described in this KB article:

    http://support.microsoft.com/kb/259971


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by TimmHamburg Tuesday, November 30, 2010 9:06 AM
    Monday, November 29, 2010 3:46 PM
    Moderator
  • Hello Cindy,

     

    thank you very much for your answer!

    >It's unfortunate that something that used to work no longer does

    I suspect something like this :-(

     

    Based on the KB article i now use a timer to look for the "margin warning" messagebox window and send a postmessage to

    simulate the OK Button - not the best solution but it works

     

    Greetings

     

    Timm

     

    Tuesday, November 30, 2010 9:06 AM