views:

11

answers:

0

I created a mailmerge from a single page which resulted in one document with about two hundred pages. What I need is a way to create separate files for each of these.

The way I see it, I have two options:

  1. Create about 200 Word documents
  2. I can print directly to PDF (Acrobat Distiller installed). with PDF printer set as default, I can try and write some VBA code to loop for each page.

1 - doesn't work - I've surfed all day, trying two or three VBA samples, but because of Headers, footers and two tables, the formatting always comes out a bit wrong (e.g. header of page also appears in footer).

2 - I've tried, but dont know how to use it. thought it might be ...

doc.PrintOut Range:=wdPrintFromTo, From:=CStr(P1), To:=CStr(P1), outputfilename:=strFileName

where p1 is an integer (ie for p1 = 1 to 200)

... but doesnt work - either blank PDF are created, or its a huge, unreadable file.

Can anyone help please?