title: Macro to copy excel range of data as table to word goes outside margins
body: <p>I want to write macro to copy table from excel to word. It should maintain formatting and must auto-fit to word. Table should not go out of range when pasted to word.</p>
  
  <pre><code>Dim wdApp As Object
  Dim wd As Object
  
  On Error Resume Next
  Set wdApp = GetObject(, "Word.Application")
  If Err.Number &lt;&gt; 0 Then
      Set wdApp = CreateObject("Word.Application")
  End If
  On Error GoTo 0
  
  Set wd = wdApp.Documents.Add
  
  wdApp.Visible = True
  
  Sheets("Sheet1").Select
  Range("A1:E36").Select
  Selection.Copy
  
  wdApp.Selection.PasteExcelTable False, False, False
  </code></pre>
  
  <p>Above code wors. It copies excel range of data as table to word. However table goes outside margins of word document.
  Data in Excel - <img src="https://i.stack.imgur.com/uV0ZS.png" alt="Source Data in excel">
  Data in Word after Copy - <img src="https://i.stack.imgur.com/EFTXu.png" alt="After Copy to Word"></p>