Excel to Word Automation - Help wtih scaling, fitting to page

jordanjv

New Member
Joined
Mar 22, 2017
Messages
1
I have created a macro to copy and paste a range of cells from Excel into a Word document. Everything seems to be copying correctly, however the information is not scaled to fit a single page in Word (it does fit a single page in Excel.) The pasted data is much larger in Word. How can I scale the pasted information to fit a single page in Word?

Here is my current code (at some point I had it figured out but somehow change it...)

Sub Email()
Range("A4:G48").Select
Selection.Copy
Set appWD = CreateObject("Word.Application.8")
appWD.Visible = True
appWD.Documents.Add.Content.PasteSpecial Link:=False, DataType:=wdPicture
With appWD.ActiveDocument.PageSetup
.TopMargin = appWD.InchesToPoints(0.4)
.BottomMargin = appWD.InchesToPoints(0.4)
.LeftMargin = appWD.InchesToPoints(0.4)
.RightMargin = appWD.InchesToPoints(0.4)
End With
End Sub
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,215,094
Messages
6,123,071
Members
449,092
Latest member
ipruravindra

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