View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Mark Ivey[_2_] Mark Ivey[_2_] is offline
external usenet poster
 
Posts: 171
Default Copy Data From Excel Into a MSWord Document

Jon may be able to answer that question better than me...

Mark

"dimm" wrote in message
...
Thankyou, that helps a lot, but I have another question. John gives a
macro
example for pasting into word as below from Excel, but what if the user
has
another instance of Word open apart from my file (myfile.doc).

How do I specify that myfile.doc should be selected instead of any other
open word document?


' Reference existing instance of Word
Set WDApp = GetObject(, "Word.Application")
' Reference active document
Set WDDoc = WDApp.ActiveDocument
' Reference active slide

' Copy the range
Selection.Copy

' Paste the range
WDApp.Selection.PasteSpecial Link:=False, DataType:=wdPasteRTF, _
Placement:= wdInLine, DisplayAsIcon:=False

' Clean up
Set WDDoc = Nothing
Set WDApp = Nothing
End If

End Sub

"Mark Ivey" wrote:

Jon Peltier has some really good information on this topic...

http://peltiertech.com/Excel/XL_PPT.html