Copy a form from excel into a new word document

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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

many thanks.
 
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:
 
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)
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top