ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy a form from excel into a new word document (https://www.excelbanter.com/excel-programming/321661-copy-form-excel-into-new-word-document.html)

Kevin

Copy a form from excel into a new word document
 
Could you tell me the vba code to copy a document from excel and paste it
into a new word document?

many thanks.

nippetee

Copy a form from excel into a new word document
 
Hello Kevin

One way could be to record a macro in word while doing the import by hand.
then go to tools|macro|visualbasiceditor and there you find newmacros from
normal|modules that contains recorded macrocodes.

Here is example code I recorded while importing an excel document to word

Selection.InlineShapes.AddOLEObject ClassType:="Excel.Sheet.8", FileName:= _
"pathtodocument\documentname.xls", _
LinkToFile:=False, DisplayAsIcon:=False

hope this helps

..nippetee

"kevin" kirjoitti:

Could you tell me the vba code to copy a document from excel and paste it
into a new word document?

many thanks.


AA2e72E

Copy a form from excel into a new word document
 
Kevin, do you want to 'copy a form' (as in your subject line) or 'copy a
document (as in your message)?

To 'copy a form', in Excel, export the form to a file (File + Export file)
and import that file in Word (File + Import File)

"kevin" wrote:

Could you tell me the vba code to copy a document from excel and paste it
into a new word document?

many thanks.


Kevin

Copy a form from excel into a new word document
 
Hi,

Sorry I didn't explain myself clearly. I want the user to activate a button
which will copy a cell range from excel and paste it into a word document ?

Can you help.

"AA2e72E" wrote:

Kevin, do you want to 'copy a form' (as in your subject line) or 'copy a
document (as in your message)?

To 'copy a form', in Excel, export the form to a file (File + Export file)
and import that file in Word (File + Import File)

"kevin" wrote:

Could you tell me the vba code to copy a document from excel and paste it
into a new word document?

many thanks.



All times are GMT +1. The time now is 10:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com