Excel to Word -> VBA -> Canvas?

pop3k

New Member
Joined
Jul 2, 2019
Messages
2
Im trying to drawing some lines, shapes in Word doc from Excel.
Can i do that? Is it some tool like Canvas?

Im connectiong with Word like below:
Code:
Sub ExcelWord()

Set wrdApp = GetObject(, "Word.Application")
Set wrdDoc = wrdApp.ActiveDocument
       
With wrdDoc

'code here

End With


Set wrdDoc = Nothing
Set wrdApp = Nothing


End Sub
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
You use VBA to add the lines and shapes, you don't need any external tools.

Are the shapes already in Excel? if so you copy and paste them
e.g.
Code:
    Sheets("MySheet").Shapes("Shape 1").Copy
    wordSelection.PasteSpecial Link:=False, DataType:=wdPasteShape, Placement:=wdInLine, DisplayAsIcon:=False

However ... Word is, tbh, a right pain in the proverbial. You need to insert bookmarks into your Word doc wherever you want stuff pasted or pick specific paragraphs. Working with page and line numbers is tricky to say the least, as Word treats page numbers as a function of printing so aren't easily accessible.

That's not very helpful, I appreciate, but I've wasted days trying to get stuff to copy between Excel and Word. And given up in the end.

If you have the option, it's far easier to work with PowerPoint than Word as you can pick specific slides and code where you want things pasted.
 
Last edited:
Upvote 0
No, i havent shapes already in Excel, i want to draw it to Word from Excel code :) I through make it in some application like Canvas.
Thanks anyway
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,214
Members
453,024
Latest member
Wingit77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top