Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Word with embedded Excel object which has reference to addin | Excel Discussion (Misc queries) | |||
Reference to an Embedded Word Object | Excel Programming | |||
Cannor strech embedded word object | Excel Discussion (Misc queries) | |||
How to load/insert/update an embedded word object to Access... | Excel Programming | |||
should be possible to view entire MS Word embedded object in MS E. | Excel Discussion (Misc queries) |