none
How to replace Bookmarks in Office Apps RRS feed

  • Question

  • Hi All,

    I am developing an app for Office which gets data from SharePoint List(Using Client Object Model) and show's it in the Task Pane of the Microsoft Word. It's done but now I want to put this List data to Word by replacing bookmarks.

    i don't want to choose this code. because it only puts data where it is selected.

     Office.context.document.setSelectedDataAsync(textToInsert, function (asyncResult) {
                if (asyncResult.status === "failed") {
                    writeToPage('Error: ' + asyncResult.error.message);
                }
            });
    I want some thing like this " Office.context.document.Bookmarks" which i am not able to found.

    Can anyone please help me in replacing bookmarks in Apps for Office 2013.

    Thanks in advance :)


    Muhammad Luqman

    Tuesday, December 31, 2013 12:19 PM

Answers

  • Hi,

    According to your description, you want to put list data to replace the bookmarks with a Task Pane App.

    However, I’m afraid you cannot achieve your goal.

    There is no such method of document object provided in the JavaScript API for Office. The App for office performs well to support Office 2013 applications by using the power of the web and standard web technologies. And it is not good at the automation of the Office document content.

    If you have any suggestions about the development of Apps for Office, you could consider posting them in the User Voice.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, January 1, 2014 9:45 AM
    Moderator
  • Hi,

    Since you are developing a Task Pane App for Office, I think it's OK to use Content Controls as a workaround to achieve the goal.

    Here is a link about how to use JavaScript in a Word 2013 task pane app to bind to content controls in a document for your reference.

    Apps for Office: Binding to and validating content controls in Word 2013


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, January 3, 2014 8:45 AM
    Moderator

All replies

  • Hi,

    According to your description, you want to put list data to replace the bookmarks with a Task Pane App.

    However, I’m afraid you cannot achieve your goal.

    There is no such method of document object provided in the JavaScript API for Office. The App for office performs well to support Office 2013 applications by using the power of the web and standard web technologies. And it is not good at the automation of the Office document content.

    If you have any suggestions about the development of Apps for Office, you could consider posting them in the User Voice.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, January 1, 2014 9:45 AM
    Moderator
  • Hi Luna,

    First of all thanks for your reply and secondly I have found an alternate solution of replacement of bookmarks, which is replacing the text of CONTENT CONTROLS in the document. We can add it from the Developer tool bar and this API allows us to replace the text. But it will be very good to use Bookmarks rather then Content Controls.

    Also tell me what Microsoft prefers for this task? Is it good to use content controls OR we have to go for VSTO Solution?

    Thanks :)


    Muhammad Luqman

    Wednesday, January 1, 2014 10:47 AM
  • Hi,

    Since you are developing a Task Pane App for Office, I think it's OK to use Content Controls as a workaround to achieve the goal.

    Here is a link about how to use JavaScript in a Word 2013 task pane app to bind to content controls in a document for your reference.

    Apps for Office: Binding to and validating content controls in Word 2013


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, January 3, 2014 8:45 AM
    Moderator