Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

Thread Tools Rate Thread Display Modes
Old 06-06-2012, 09:40 AM   #1
Newly Registered User
Join Date: May 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Ben5505 is on a distinguished road
Read text from word doc bookmark

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?


Ben5505 is offline   Reply With Quote

bookmark , read , text , word

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Open OLE Word Doc (and GoTo Bookmark in Doc) Jason1971 Modules & VBA 2 03-08-2010 08:39 PM
Bookmark in a Text Box in Word johncallaghan Visual Basic 0 12-22-2008 12:57 PM
Access/Word/Bookmark Mike375 General 2 09-25-2008 12:03 AM
How to read first word from a text box Ashfaque General 19 01-29-2008 12:16 PM
Exporting a Report to Word Bookmark robhiengler Reports 0 07-26-2004 04:04 AM

All times are GMT -8. The time now is 01:20 PM.

Microsoft Access Help
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post

Sponsored Links

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World