Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy text from embedded Word object?
In a worksheet is an embedded Word object. When I click a button, I
want the object's text to copy to cell A1. Can anyone please help me with this? I'm using Excel 2003. Thanks, Chuck |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy text from embedded Word object?
Sub Macro1()
' For Each obj In ActiveSheet.OLEObjects If InStr(obj.progID, "Word.Document") 0 Then 'open word document obj.Activate Set WordDoc = obj.Object.Application.ActiveDocument Set WordApp = obj.Application pos = WordDoc.words.first.Start pos2 = WordDoc.words.last.End Set WordRange = WordDoc.Range(Start:=pos, End:=pos2) WordText = WordRange.Text ThisWorkbook.ActiveSheet.Range("A1") = WordText Exit For End If Next obj End Sub "c mateland" wrote: In a worksheet is an embedded Word object. When I click a button, I want the object's text to copy to cell A1. Can anyone please help me with this? I'm using Excel 2003. Thanks, Chuck |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need text from embedded Word object | Excel Programming | |||
Embedded word object | Excel Programming | |||
Copy text with formatting from an Excel cell into an embedded Word object? | Excel Programming | |||
Extracting text from embedded Word Object | Excel Programming | |||
Reference to an Embedded Word Object | Excel Programming |