LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default getting data from word into excel

Hello,
I have the following issue: i'd like, from excel, to open a word file,
copy the entire content (plain text), and then copy it into a text box
in excel.
I have written the following code, however nothing happens when I
execute it and I can't find what is wrong.. Thanks for your help,
Nicolas

Public Sub DonnéesWordVersExcel()


Dim wdDoc As Word.Document
Dim AppWord As Word.Application



Set AppWord = New Word.Application

AppWord.ShowMe
AppWord.Visible = True

Set wdDoc = AppWord.Documents.Open("c:\hello.doc", ReadOnly:=False)

With AppWord
.Selection.WholeStory
myTxt = .Selection
End With

Windows("wordtest.xls").Activate
Sheets("Sheet1").Activate

ActiveSheet.Shapes("Text Box 16").Select
Selection.Characters.Text = myTxt
Cells(16, 2).Select
'ThisWorkbook.Worksheets("Sheet1").Paste

AppWord.Application.Quit


End Sub

 
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
Get Data from Word to Excel Francis Excel Worksheet Functions 6 May 24th 09 07:38 PM
Copy excel data (inc. textbox data) into Word Sarah (OGI) Excel Discussion (Misc queries) 0 August 14th 07 05:00 PM
Transfer Excel data into Word, including text box data Sarah (OGI) Excel Discussion (Misc queries) 0 July 13th 07 10:06 AM
I want to convert word column data to excel row data to sort addre craywill Excel Discussion (Misc queries) 0 April 18th 06 07:16 PM
Print labels by using Excel data in a Word mail into word Zoey Excel Discussion (Misc queries) 1 November 1st 05 09:08 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"