Link to home
Start Free TrialLog in
Avatar of thenelson
thenelson

asked on

copy text from another Word document to a string

MS Word VBA: I can copy text defined by a bookmark from another Word document into the current document using InsertFile. Example:
Selection.InsertFile strDocName, "CurrentMeds"

Open in new window

Is there a way to copy text defined by a bookmark from another Word document to a VBA string instead?
ASKER CERTIFIED SOLUTION
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of thenelson
thenelson

ASKER

Actually your code would get the bookmark of the current document not the "other" document. But there is a section in the procedure where the other document is the active document so I placed your code there and it worked.

Thanks!
You're welcome!

Actually, I just showed you how to get the Bookmark text into a string variable. Document can be set as per your requirement. Glad you tweaked it as per your need. :)