title: Powershell - How can I save a single page from a word document?
body: <p>Need some help. Trying to build a tool that takes a 180 page document and reads the page number and saves that single page instance as a new file and an incremented file name. I've got the iteration and file process right but I have yet to find a way to select a single page from word. This may not be the best method but its working as all other attempts have failed. I even tried using the method suggested to adding page numbers to the footer on each page but it wont work with existing documents..only new documents. Here's what I have so far if anyone can pick and pull this apart of suggest somethings I'd appreciate it. </p>
  
  <p>As a side note within that while loop namely; per page I want it to do really a save instance of the current page only. Right now its doing something different and just copying the entire thing to make sure the loop process was somewhat functional.</p>
  
  <pre><code>[int] $c = 1
  [int] $total = 2
  
  #$colFiles = gci("C:\xx\xx\Documents\xx\xx\*.docx") 
  #$filebase = "FILENAME"
  
  
  $objWord = New-Object -comobject Word.Application  
  $objWord.Visible = $True 
  $template = "C:\x\x\Documents\xx\xx.docx"  
  $doc = $objWord.Documents.Open($template)
  
  #$objDoc = $objWord.Documents.Open("C:\xx\xx\xx\xx\" + $objFile.Name) 
  $filebase = "xx.docx"
  $path = "C:\Users\username\Documents\vbscripting\"
  $original = $path + $filebase
  
  $baseFile = $filebase + "_" + $c + ".docx"
  
  
  while($total -gt $c)
  {
      $filename = $path + $filebase + "_" + $c + ".docx"
      $destination = "C:\xx\xx\Documents\xx\xx_"  + $c + ".docx"
      Copy-Item -Path "C:\xx\xx\Documents\xx\xx\xx.docx" -Destination $destination -Force
      ++$c
     Write $filename
  }
  </code></pre>