title: remove blank pages from word file
body: <p>I am using a word object to reference the word document. I am copying some images to each page and converting that 150+ pages word file to PDF.</p>
  
  <pre><code>Dim wordapp As Object
  Set wordapp = CreateObject("Word.Application")
  </code></pre>
  
  <p>To add 1st page to that word file i am using</p>
  
  <pre><code>wordapp.documents.Add
  </code></pre>
  
  <p>To add next pages i am using the code in next line,</p>
  
  <pre><code>wordapp.ActiveDocument.Sections.Add
  </code></pre>
  
  <p>Above code does not insert any blank page in word file and conversion of same to pdf is succesfull. </p>
  
  <p>For your information,</p>
  
  <p>On my computer environment is Windows 10, Office 2013.  But When i use same on another computer then it introduces blank pages. Here Windows 10 and Office 2010.</p>
  
  <p>complete code is here.
      pagenumber 
  specifies that its first time we are trying to create word dcument or not. so nest time only page is added</p>
  
  <pre><code>If pagenumber = 1 Then
  Dim wordapp As Object
  
  Set wordapp = CreateObject("Word.Application")
  wordapp.documents.Add
  wordapp.Visible = False
  Application.Wait (Now + TimeValue("0:00:03"))
  With wordapp.ActiveDocument.PageSetup
       .LeftMargin = 36
       .RightMargin = 36
       .TopMargin = 36
       .BottomMargin = 36
  End With
  Else
      'add page at end AND copy the picture ahead of it
      wordapp.ActiveDocument.Sections.Add
      Application.Wait (Now + TimeValue("0:00:03"))
  End If
  
  Dim selrange As Range
  Application.CutCopyMode = False
  Workbooks("" &amp; workbookname).Sheets("Tax Invoice     Format").Range("A1:L47").CopyPicture Appearance:=xlScreen, Format:=xlPicture
  wordapp.Selection.Goto wdGoToPage, wdGoToAbsolute, count:=pagenumber
  wordapp.Selection.Paste (ppPasteEnhancedMetafile)
  wordapp.ActiveDocument.inlineshapes(pagenumber).LockAspectRatio =     msoFalse
  wordapp.ActiveDocument.inlineshapes(pagenumber).Height = 735
  wordapp.ActiveDocument.inlineshapes(pagenumber).Width = 540
  Application.Wait (Now + TimeValue("0:00:03"))
  
  pagenumber = pagenumber + 1
  *loop continues*
  </code></pre>