Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Using Word Bookmarks to read Text

Hi I need to collect text from a word Document and put it
in a msgbox.
I am using this code but it wont work can someone help?.

with wdApp
wdDoc.bookmarks("ProbTitle").Select
.Selection.EndKey Unit:=wdLine, Extend:=wdExtend
msgbox .Selection.Text
end with

TIA
Charles



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Using Word Bookmarks to read Text

If you don't have a reference set to word, the the constants wdLine and
wdExtend are viewed as uninitialized variables with a value of zero (which
probably isn't the value intended). Either create a reference to the word
object model or hard code the probably numeric value of the constants.

--
Regards,
Tom Ogilvy

"Charles" wrote in message
...
Hi I need to collect text from a word Document and put it
in a msgbox.
I am using this code but it wont work can someone help?.

with wdApp
wdDoc.bookmarks("ProbTitle").Select
.Selection.EndKey Unit:=wdLine, Extend:=wdExtend
msgbox .Selection.Text
end with

TIA
Charles





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Using Word Bookmarks to read Text

Try:

msgbox wdDoc.bookmarks("ProbTitle").Range.Text

--

"Charles" wrote in message ...
Hi I need to collect text from a word Document and put it
in a msgbox.
I am using this code but it wont work can someone help?.

with wdApp
wdDoc.bookmarks("ProbTitle").Select
.Selection.EndKey Unit:=wdLine, Extend:=wdExtend
msgbox .Selection.Text
end with

TIA
Charles

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross reference bookmarks in a Microsoft word document FredN Excel Discussion (Misc queries) 0 April 7th 08 04:33 PM
excel to read a row, if word 'x' in then put on other sheet ?? Andy100 New Users to Excel 12 October 13th 05 02:49 PM
Opening Excel Workbook from Word using VBA - Always Read Only Alan Excel Programming 0 November 5th 03 02:55 AM
Read embedded word document by VBA rs Excel Programming 0 August 26th 03 04:33 PM
Read embedded word document rs Excel Programming 0 August 22nd 03 07:24 PM


All times are GMT +1. The time now is 10:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"