View Single Post
 
Old 04-16-2018, 01:20 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Something seems to have been lost in the explanation. However you seem to have a document with a macro (ThisDocument) and another document with a Bookmarked text and you want to copy that bookmarked text to the document with the macro? That being the case

Code:
Dim oDoc As Document
Dim oTarget As Document
Dim oBM As Range
Dim oRng As Range
    Set oTarget = ThisDocument
    Set oRng = oTarget.Range
    oRng.Collapse 0
    Set oDoc = Documents.Open("C:\Users\jovany\Desktop\NEW WOSPC 9.2.1_RMIR - Rollout.doc")
    Set oBM = oDoc.Bookmarks("bookmark").Range
    oRng.FormattedText = oBM.FormattedText
    oRng.Bookmarks.Add "bookmark2"
    oTarget.Activate
    Set oDoc = Nothing
    Set oTarget = Nothing
    Set oRng = Nothing
    Set oBM = Nothing
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote