Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Extracting text from embedded Word Object

We have an embedded word object within our workbook and would like to
programmatically extract the text within the object and paste it in a
predefined text box. How would we go about doing this?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 163
Default Extracting text from embedded Word Object

Hi Barb,

like this:

Sub Test10000()

Dim oWrd As Word.Application
Dim rTmp As Word.Range
Dim s As String
Dim oWrk As Workbook
Dim oSht As Worksheet
Set oWrk = ActiveWorkbook
Set oSht = ActiveSheet
oSht.OLEObjects(1).Activate
Set oWrd = GetObject(, "Word.application")
Set rTmp = oWrd.ActiveDocument.Range
s = rTmp.text
oWrd.ActiveDocument.Close
'oWrd.Quit
oSht.OLEObjects("TextBox1").Object.Value = s
End Sub

Don't try to paste a 100 pages word doc with pictures! ;-)

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
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
Word with embedded Excel object which has reference to addin Tom Chau Excel Discussion (Misc queries) 0 September 6th 06 02:25 AM
Reference to an Embedded Word Object [email protected] Excel Programming 2 April 20th 06 03:05 PM
Cannor strech embedded word object BartDesc Excel Discussion (Misc queries) 2 March 10th 06 08:15 AM
How to load/insert/update an embedded word object to Access... MJ Excel Programming 0 February 21st 06 11:50 PM
should be possible to view entire MS Word embedded object in MS E. Phillip M. Feldman Excel Discussion (Misc queries) 1 April 21st 05 01:21 PM


All times are GMT +1. The time now is 03:46 PM.

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"