Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Copy Data From Excel Into a MSWord Document

Hi folks,

As a follow on to my previous question (Thanks again for the help)......I
want to copy and paste data from MS Excel into MS Word. Is this even possible
with VBA?

For example:

If I have text in cell B3, and I want to copy it into my MSWord document,
right justify it and format it to be Bold and Italic......then I want to
enter a space below this text in MS Word, and copy in the cell value from
cell A4 onto the next line of my Word document left justified?

Does that make sense....can I do this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Copy Data From Excel Into a MSWord Document

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

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


Mark

"dimm" wrote in message
...
Hi folks,

As a follow on to my previous question (Thanks again for the help)......I
want to copy and paste data from MS Excel into MS Word. Is this even
possible
with VBA?

For example:

If I have text in cell B3, and I want to copy it into my MSWord document,
right justify it and format it to be Bold and Italic......then I want to
enter a space below this text in MS Word, and copy in the cell value from
cell A4 onto the next line of my Word document left justified?

Does that make sense....can I do this?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Copy Data From Excel Into a MSWord Document

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Copy Data From Excel Into a MSWord Document

I just did this yesterday:
http://www.microsoft.com/office/comm...r=US&sloc=&p=1

Clearly, you will have to customize it a little for your own situation, but
that should give you (most of) what you want.


Regards,
Ryan--

--
RyGuy


"Mark Ivey" wrote:

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


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
Can I import data from MSWord into Excel? How Please? Thank you TimH ! ! For the link -) JMH Excel Discussion (Misc queries) 2 December 4th 09 11:04 PM
How do I Export Excell line data to MSWord automatically William Hawke Excel Discussion (Misc queries) 1 June 1st 07 09:22 PM
Using txtMy_GotFocus or txtMy_LostFocus in MSWord or Excel jonno Excel Programming 3 September 25th 06 08:55 PM
copy excel worksheet into msword with row, column headings and gr. eleda Excel Discussion (Misc queries) 0 January 19th 05 01:31 AM
MSWORD to EXCEL kmlove Excel Discussion (Misc queries) 1 January 7th 05 11:39 PM


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

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"