Where are the Office Scripts Examples for MS Word

Linda Krausz 6 Reputation points
2022-02-03T00:27:35.103+00:00

Excel examples abound, but the samples for MS Word seem to be few and far between. For example I want to know how to update a bookmark in a document, is there a sample that describes how to do that? The samples all go to 'first' or 'last' paragraph of the document, or, I assume, a paragraph number. Informative as they are, I don't know how often these samples are useful in reality, whereas finding some text or a bookmark and then inserting something is a fairly common task we do in VBA.

The API reference info is all about Excel, even the tag here for Office Scripts only references Excel. Where is the comprehensive MS Word reference material for Office Scripts.

Microsoft 365 and Office Word For business Windows
{count} vote

2 answers

Sort by: Most helpful
  1. Charles Kenyon 3,121 Reputation points Volunteer Moderator
    2022-02-03T17:18:57.197+00:00

    Yes, there is much more available for Excel vba than Word vba.

    See this Word MVP page.
    https://wordmvp.com/FAQs/MacrosVBA.htm

    See also this forum:
    https://www.msofficeforums.com/word-vba/

    2 people found this answer helpful.

  2. Emily Hua-MSFT 27,796 Reputation points
    2022-02-03T05:44:06.887+00:00

    Hi @Linda Krausz

    Welcome to Q&A forum ~

    Please check whther the following link is helpful.
    Word VBA reference

    Such as for bookmark, please refer to "Bookmarks object (Word)", there are some simple samples.

    Here is another link for Word development, maybe you can have a look.
    Word add-ins documentation
    If you have any issues on Word development, you can post thread on following forums.
    Word add-ins developer community

    Besides, to better help you, I would add the tag "office-vba-dev", as the tag "office-word-itpro" focuses more on general issue of Word desktop client.

    Thanks for your understanding.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.