none
Programatically show Document Preview in custom tab in Backstage view RRS feed

  • Question

  • Hi,

    I have a custom tab developed in Backstage view.

    I want to add a group in tab which shows document preview (like how it shows in Print tab or at least the way it shows in Info tab).

    Is this possible through PIAs/VSTO APIs? If yes, please provide a pointer to the article or MSDN documentation.

    Thanks in Advance,

     


    Mahesh Devjibhai Dhola [Please mark best and acceptable replie(s) as the ANSWER(S)]
    Wednesday, April 20, 2011 6:39 AM

Answers

  • I have a custom tab developed in Backstage view.

    I want to add a group in tab which shows document preview (like how it shows in Print tab or at least the way it shows in Info tab).

    Is this possible through PIAs/VSTO APIs? If yes, please provide a pointer to the article or MSDN documentation.


    It appears there is the following control group available:

    GroupPrintPreview group None (Backstage View) TabPrint

    You can try putting that group in the <backstage> part of your Ribbon XML. FWIW I looked it up in the Control IDs for Office 2010 which you should be able to d/l: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=3f2fe784-610e-4bf1-8143-41e481993ac6&displaylang=en
    Cindy Meister, VSTO/Word MVP
    • Marked as answer by Indian Ocean Friday, April 22, 2011 8:29 AM
    Friday, April 22, 2011 7:10 AM
    Moderator
  • Hi Mahesh

    <<is there any possibility to show the actual document instead of preview in the lower part of the tab>>

    No.

    <<Can I show the live preview kind of thing instead of static?>>

    There's nothing built-in that can give you this. I'm not sure whether it can be done at all the way you envision...

    <<Now the requirement is, on click of the bookmark hyperlink in first group, I want to show the bookmark content selected in the document in lower half where document preview is shown. If I click on other bookmark, it should show the another bookmark content selected in the preview.

    Is this possible to do with the preview group you have mentioned?>>

    Not that I know of, no. As far as I know, there is no way for you to control what the end-user sees in the built-in preview control. The user can zoom, scroll and choose pages, but there's nothing in the Ribbon or Word/Office object model that gives you access to these capabilities. Possibly, through the Windows API and/or the Ribbon Accessibility interface, but best I can do is offer these as possibilities for investigation.


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by Indian Ocean Monday, April 25, 2011 5:32 AM
    Sunday, April 24, 2011 6:06 AM
    Moderator

All replies

  • Hi Indian,

     

    Thanks for posting in the MSDN Forum.

     

    Would you tell me your Word version? Do you use Word 2007 or Word 2010?

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, April 21, 2011 6:58 AM
    Moderator
  • Hi Tom Xu,

    Thank you for reply.

    I though Backstage view is only extensible in Word 2010 not in Word 2007 so I did not mention the version.

    My question was about Word 2010. Another question in addition to my earlier questions, is customization possible in Word 2007 the same way?

    Thanks in advance,

     


    Mahesh Devjibhai Dhola [Please mark best and acceptable replie(s) as the ANSWER(S)]
    Thursday, April 21, 2011 5:31 PM
  • Hi Indian,

     

    Yes, Backstage only for Office 2007 and Office 2010. However there exists some different when we customized the customUI.xml between them. I’m not sure how to do it for your goal, I have consulted Word programmability Questions Group for it. I hope they are able to provide you a workaround.

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Friday, April 22, 2011 2:12 AM
    Moderator
  • Hi Tom

    <<Yes, Backstage only for Office 2007 and Office 2010>>

    Actually, the OP is right: Backstage exists only for Office 2010. There is no Backstage in Office 2007, only the Ribbon.


    Cindy Meister, VSTO/Word MVP
    Friday, April 22, 2011 6:56 AM
    Moderator
  • I have a custom tab developed in Backstage view.

    I want to add a group in tab which shows document preview (like how it shows in Print tab or at least the way it shows in Info tab).

    Is this possible through PIAs/VSTO APIs? If yes, please provide a pointer to the article or MSDN documentation.


    It appears there is the following control group available:

    GroupPrintPreview group None (Backstage View) TabPrint

    You can try putting that group in the <backstage> part of your Ribbon XML. FWIW I looked it up in the Control IDs for Office 2010 which you should be able to d/l: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=3f2fe784-610e-4bf1-8143-41e481993ac6&displaylang=en
    Cindy Meister, VSTO/Word MVP
    • Marked as answer by Indian Ocean Friday, April 22, 2011 8:29 AM
    Friday, April 22, 2011 7:10 AM
    Moderator
  • Hi Cindy,

    Thanks for the answer.

    Another question on the same line I have is, Can I show the live preview kind of thing instead of static?

    let me explain the requirement,

    Lets say I design a custom Tab in Backstage.

    In one group (uppar half of the tab), I show list of the bookmarks with hyperlink exists in the document.

    Now in the lower half of the tab, I want to show the document (actual document or preview). As per your previous answer, it seems I would be able to show preview.

    Now the requirement is, on click of the bookmark hyperlink in first group, I want to show the bookmark content selected in the document in lower half where document preview is shown. If I click on other bookmark, it should show the another bookmark content selected in the preview.

    Is this possible to do with the preview group you have mentioned?

    Another question is, is there any possibility to show the actual document instead of preview in the lower part of the tab, if so, I have some more requirement to allow to do some operation on the document using this UI (e.g. select some content, using customized context manu, do some operation).

    Please provide me some pointer or guidance on this.

    Thanks once again for your answer and thanks in advance too :)

     


    Mahesh Devjibhai Dhola [Please mark best and acceptable replie(s) as the ANSWER(S)]
    Friday, April 22, 2011 8:29 AM
  • Hi Mahesh

    <<is there any possibility to show the actual document instead of preview in the lower part of the tab>>

    No.

    <<Can I show the live preview kind of thing instead of static?>>

    There's nothing built-in that can give you this. I'm not sure whether it can be done at all the way you envision...

    <<Now the requirement is, on click of the bookmark hyperlink in first group, I want to show the bookmark content selected in the document in lower half where document preview is shown. If I click on other bookmark, it should show the another bookmark content selected in the preview.

    Is this possible to do with the preview group you have mentioned?>>

    Not that I know of, no. As far as I know, there is no way for you to control what the end-user sees in the built-in preview control. The user can zoom, scroll and choose pages, but there's nothing in the Ribbon or Word/Office object model that gives you access to these capabilities. Possibly, through the Windows API and/or the Ribbon Accessibility interface, but best I can do is offer these as possibilities for investigation.


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by Indian Ocean Monday, April 25, 2011 5:32 AM
    Sunday, April 24, 2011 6:06 AM
    Moderator
  • Thank you Cindy.

    It answers my questions. I would investigate as you suggest or change the design.


    Mahesh Devjibhai Dhola [Please mark best and acceptable replie(s) as the ANSWER(S)]
    Monday, April 25, 2011 5:32 AM