I have code (as part of the UserForm_Activate procedure behind a form) which opens a document to read all of the bookmarks in the opened document.
Application.Documents.Open FileName:=strRequirementsDocument, _
ReadOnly:=True, _
AddToRecentFiles:=False
The problem is, if this document is already open by another user, I get that annoying “Would you like to make a copy?” message, which I would like to avoid. Is there any way to tell Word to open the document as a copy in code?
The underlying problem, as you probably have divined, is that I want to return the bookmark names (and the text referred to by the bookmark) to the user in a dialog box, allow them to select the bookmark, and display the text referred to by the bookmark in the dialog box. I can send you all of my code if you need to see it to understand me.
The user selects a bookmark, clicks OK, and an INCLUDETEXT field is inserted in his or her open document, containing the text referred to by the bookmark. This allows cross-references to a published document to be inserted in another document.
If there is a way to read all of the bookmarks (and the text they refer to) in a document without opening it, that would be VERY cool.
Or if you know of some other way to insert cross-references between documents, that would help as well.
Thanks in advance to anyone who reads and responds.