View Single Post
  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Mail merge to PDF

I doubt that any of the "features" that you are getting can be controlled by
tweaking the addin.

Going back to your original quest, I believe, though I have not tried it,
that even if you mailmerge to a new document (that will contain all of the
reports), the links from the table of contents to the sections of the
document will not be present.

That being the case, it would be necessary to create a "roll-your-own"
equivalent to mail merge that instead of using a mail merge main document
containing MERGEFIELDS, used a template with DOCVARIABLE fields in place of
the merge fields and then you use VBA code to iterate through what was the
data soure, creating a new document from the template for each record in the
data source, and setting the values of variables in the document to the
values in the fields for the current record, and then updated the fields in
the document so that the DOCVARIABLE fields displayed that data. The code
would then save that document before going on to the next record and
repeating the process.

You then maybe able to use something like fellow MVP Jonathon West's
Multilinker to create the .pdf documents

See http://www.intelligentdocuments.co.uk/multilinker.htm

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Divinite" wrote in message
...
I just tried it out and here's what I noticed:

- It created bookmarks based on headers for the document (yeah!)
- It did not create the bookmark links that I created in the ToC at
the beginning of the document (Question here - If I left in the
generated ToC would it work?)
- It removed the transparency on my logo images in the header, adding
a black background to them
- It did not include the .docx on the first merge, but did on the rest
(I'd prefer it didn't on all, of course)
- It messed up the formatting on my cover page (put a huge color block
instead of just a border on the first one, put one of the sides as
gray instead of the assigned color on the rest)
- It changed the style for my section intros (previously with a dashed
border on top and one side, now a solid border)

Thank you!

Jessica

On Aug 1, 5:00 am, "Graham Mayor" wrote:
Good thinking - though it was not so straightforward to modify the add-in
to
adopt this procedure and maintain compatibility with Word versions below
2007

I think I have cracked it and have posted a version on my web
site -http://www.gmayor.com/Extras/MMtoDocsRev32.zip

which the OP can try out. It requires the Microsoft PDF plug-in for Word
2007 -http://www.microsoft.com/downloads/details.aspx?FamilyID=4d951911-3e7....
, but still requires Acrobat for Word versions below 2007.

It works with Word 2007 and my test files, adding the extension .pdf to
the
filename produced by the splitter eg filename.docx.pdf. I suppose I could
have stripped off the docx before renaming, but frankly life's too short.

Please try and break it.

--

Graham Mayor - Word MVP

My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org


Doug Robbins - Word MVP wrote:

Hi Graham,


I think if Word 2007 is being used, we should be able to use code
like the following, instead of using the PDF printer


ActiveDocument.ExportAsFixedFormat OutputFileName:= _
"C:\Documents and Settings\Doug Robbins\My Documents\Chris
Armstrong\Doc3.pdf" _
, ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False,
OptimizeFor:= _
wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=1,
To:=1, _
Item:=wdExportDocumentContent, IncludeDocProps:=True,
KeepIRM:=True, _
CreateBookmarks:=wdExportCreateHeadingBookmarks,
DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False


The above was recorded, except that I changed the CreateBookmarks
setting to wdExportCreateHeadingBookmarks, which I assume may allow
the functionality to click on a table of contents entry and have the
focus move to that part of the document.


I am not however completely sure of that and think that a
"roll-your-own" equivalent to mailmerge may be required where you
start with the main documnet in the form of a template with
DOCVARIABLE fields in place of MERGEFIELDS and then have a macro that
iterates through the data source creating a new document from the
template for each record and setting the values of variables in the
document to the values in the fields in that record, then saving that
file in the required format.
"Graham Mayor" wrote in message
...
The reason this occurs is that the add-in simply prints to the Adobe
driver and does not use the Adobe add-in for Word which transfers the
bookmarks. I cannot see an easy solution to your problem, though
Doug may have some ideas.


--

Graham Mayor - Word MVP


My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org


Divinite wrote:
I've got a large mail merge document that I'm using to create
multiple reports. I'm using the add-in from he


http://www.gmayor.com/individual_merge_letters.htm


The issue I'm having is that the automatically generated ToC won't
update when I do the merge (all the graphics do)


Since the ToC won't change as the design is static and only numbers
in tables and graphics change, I tried pasting a static version in
and creating bookmarks in Word pointing to the section headers. When
I
run the merge (and my PDF settings all say to keep
bookmarks), it strips the ToC and doesn't place the bookmarks in
the created files. I upgraded to Acrobat 9 yesterday to see if that
would help, it
didn't.


Any ideas?


Thank you in advance.