title: Splitting MS Publisher 2010 document into multiple files
body: <p>I want to split a multi-page MS Publisher 2010 document into a set of separate documents, one per page.</p>
  
  <p>The starting document is from a mail-merge, and I am trying to produce a set of numbered and named tickets as PDFs to send to people for an event (this is for a charity). The mail-merge seems to work fine and I can save the merged document and it looks OK with e.g. a list of fifty people giving me a 50-page document.</p>
  
  <p>Ideally the result would be a set of PDFs.</p>
  
  <p>I have tried to create some simple VBA code to do this, but it is not working consistently. If I try this very simple macro below , I get the correct number of documents, but only perhaps 1 or 2 documents with the correct contents out of every five. Most of the documents are completely empty.</p>
  
  <pre><code>Sub splitter()
  Dim i As Integer
  Dim Source As Document
  Dim Target As Document
  
  Set Source = ActiveDocument
  
  For i = 1 To Source.Pages.Count
      Set Target = Documents.Add
      Source.Pages(i).Shapes.Range.Copy
      Target.Pages(1).Shapes.Paste
      Target.SaveAs Filename:="C:\Temp\Ticket_" &amp; i
      Target.Close
      Set Target = Nothing
      Next i
  
  End Sub
  </code></pre>
  
  <p>I did sometimes get an error that the clipboard is busy, but not always.</p>
  
  <p>Another approach might be to start with the master document and do this looping over the separate documents and fill in the personal details for each person's ticket and directly produce the PDFs. But that seems more complex, and I am not a VB programmer (but been doing C++ etc for 20+ years, so I can program :-) )</p>
  
  <p>A final annoyance is that it seems to keep opening a new Publisher window for each document. It takes a while to then close 50+ copies of publisher, and the laptop starts to crawl...</p>
  
  <p>Please advise how best to get round these issues. I am probably missing something trivial, being a relative VB(A) newbie.</p>
  
  <p>Thanks in advance for any suggestions</p>