Read text from word doc bookmark (1 Viewer)

Ben5505

Registered User.
Local time
Today, 10:24
Joined
May 22, 2012
Messages
10
I'm having trouble reading text from a word document bookmark

Basically my code is


Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document

Set wrdApp = CreateObject("Word.Application")
Set wrdDoc = wrdApp.Documents.Open(filepath)

wrdDoc.Bookmarks("Bookmark1").Range = "New York"
Debug.Print (wrdDoc.Bookmarks("Bookmark1").Range.Text)


The code properly inserts "New York" at the bookmark. However, the debug statement is always blank. For some reason, it's not reading the text. Any ideas?

Thanks
 

Users who are viewing this thread

Top Bottom