I am copying a cell range from Excel to Word which contains several tables. I need to have my document set to portrait. The issue is the copied tables width is larger than width of Word document page. So I can only see part of the table, the other part goes out of the Word document, hence can't see it.
Once the Word doc is created I can manually shrink the table width to fit Word documents page width. How can I achieve that in programmatically using Office Interop?
document.PageSetup.PageWidth = (float)500
didn't work out for me.
I saw there is a property as AutoFitBehavior
: Word.WdAutoFitBehavior.wdAutoFitWindow
but not sure how it can be apply to the Word document.
Appreciate any help on this?