How to detect the print preview window of Office2010? RRS feed

  • Question

  • Would like to know how to know whether the word / excel in the print preview state.
    I find online solutions, through the use of "Application.CommandBars.GetVisibleMso the (TabPrintPreview")
    It can acquire the status of the Print Preview button, if the Enable true currently in print preview state, but this method only support Office2007 office2010 this method is invalid, I would like to ask if you have any good way.
    Thank you
    Wednesday, May 15, 2013 8:13 AM


All replies

  • try this
    var isPreview = ActiveDocument.ActiveWindow.View.Type == WdViewType.wdPrintPreview;

    Faisal Ahmed Farooqui —————————— If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Wednesday, May 15, 2013 1:43 PM
  • This method is useless, office2010, select the Files tab in the Print menu, Print Preview window appears, could not be detected.
    Friday, May 17, 2013 1:20 AM