PC Review


Reply
Thread Tools Rate Thread

Copy text from embedded Word object?

 
 
c mateland
Guest
Posts: n/a
 
      3rd Jun 2008
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 With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      4th Jun 2008
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word cannot open an embedded word document object when in read-onl Johan Eeckhout Microsoft Word Document Management 0 16th Jul 2008 01:04 PM
Need text from embedded Word object c mateland Microsoft Excel Programming 2 3rd Jun 2008 12:10 AM
Copy text with formatting from an Excel cell into an embedded Word object? Lawrence.Colombo@gmail.com Microsoft Excel Programming 0 8th Jan 2007 05:32 PM
Extracting text from embedded Word Object =?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?= Microsoft Excel Programming 1 25th Sep 2006 10:49 PM
Copy Embedded OLE object from Access to Word =?Utf-8?B?UmllcyBTcHJ1aXQ=?= Microsoft Access Form Coding 1 1st Feb 2005 12:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:57 PM.