Hi. Then you can use "OLE Automation". How about trying this macro?
Sub CopyFromWord()
Dim wordApp As Object
Dim wordDoc As Object
'started the Word
Set wordApp = CreateObject("Word.Application")
With wordApp
.Visible = True
.WindowState = wdWindowStateNormal
.Documents.Add
Set wordDoc = .ActiveDocument
End With
'inserted arbitrary text (is able to omit)
With wordApp.Selection
.InsertAfter "Created time: "
.InsertAfter Now()
End With
'[Select All] and [Copy]
With wordApp.Selection
.WholeStory
.Copy
End With
'pasted to this worksheet "sheet1"
ThisWorkbook.Sheets("sheet1").Range("A1").PasteSpecial xlPasteValues
'saved word document
wordDoc.SaveAs "test.doc"
wordDoc.Close
'quitted the Word
wordApp.Quit
Set wordDoc = Nothing
Set wordApp = Nothing
End Sub
SAMURA
(e-mail address removed)
fitful_thought said:
Hello,
I'm using excel to create a new document in word.
When the word document is created I would like to select all and copy.
Can I do this from the excel macro?