Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Extracting Text from Embedded Word Documents in Excel

I have a report that uses embedded Word documents in Excel for a technician
to write a narrative on a project in addition to his/her measurements that
are entered in Excel's cells. I am looking for an automated way to open an
embedded Word document in the Excel report, extract the text from the Word
document, and paste it into a separate excel file. Is this possible?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Extracting Text from Embedded Word Documents in Excel

Would not be more simple to enter the text into Excel and drop the Word
aspect ?
Unless you <really need the bells and whistles that a word processor
offers.

Anyway, this is by no means great, but works and should give you a starting
point. You can change to late binding late, once you have the Word code
figured out.

Private Sub CommandButton1_Click()
Dim WordDoc As OLEObject
Dim WordApp As Word.Application

Set WordDoc = ActiveSheet.OLEObjects(1)

With WordDoc
.Activate
Set WordApp = .Object.Application
End With

With WordApp
.ActiveDocument.Select
.Selection.wholestory
.Selection.Copy
.ActiveDocument.Close False
.Quit
End With

Range("A1").Select
ActiveSheet.PasteSpecial Format:="Unicode Text"

End Sub

NickHK

"Marc C" wrote in message
...
I have a report that uses embedded Word documents in Excel for a

technician
to write a narrative on a project in addition to his/her measurements that
are entered in Excel's cells. I am looking for an automated way to open

an
embedded Word document in the Excel report, extract the text from the Word
document, and paste it into a separate excel file. Is this possible?



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
embedded documents - label text reverts to a default njmeatball Excel Discussion (Misc queries) 0 May 1st 09 04:46 AM
Extracting specific data from inconsistant multiple word documents Matt Bennette[_2_] Excel Discussion (Misc queries) 4 January 5th 09 01:30 PM
Extracting text from embedded Word Object Barb Reinhardt Excel Programming 1 September 25th 06 10:49 PM
How to create an embedded Excel workbook in Word with cell text Drew Lettington Excel Programming 0 July 13th 06 07:53 PM
error excel if embedded in word documents MZ Excel Programming 2 March 10th 05 12:01 PM


All times are GMT +1. The time now is 06:02 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"