Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Copy Data From Excel Into a MSWord Document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dimm - 16 Mar 2008 23:00 GMT
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?
Mark Ivey - 17 Mar 2008 00:50 GMT
Jon Peltier has some really good information on this topic...

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

Mark

> Hi folks,
>
[quoted text clipped - 11 lines]
>
> Does that make sense....can I do this?
dimm - 17 Mar 2008 15:55 GMT
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

> Jon Peltier has some really good information on this topic...
>
> http://peltiertech.com/Excel/XL_PPT.html
Mark Ivey - 18 Mar 2008 01:32 GMT
Jon may be able to answer that question better than me...

Mark

> Thankyou, that helps a lot, but I have another question. John gives a
> macro
[quoted text clipped - 28 lines]
>>
>> http://peltiertech.com/Excel/XL_PPT.html
ryguy7272 - 19 Mar 2008 14:05 GMT
I just did this yesterday:
http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public
.word.vba.general&tid=230f276e-0581-43e9-b168-d86fdd3ac6b3&cat=&lang=en&cr=US&sl
oc=&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--

Signature

RyGuy

> Jon may be able to answer that question better than me...
>
[quoted text clipped - 32 lines]
> >>
> >> http://peltiertech.com/Excel/XL_PPT.html 
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.