View Single Post
  #11   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

Set it to

wdExportOptimizeForOnScreen

According to the VBE Help, it results in a lower quality image and results
in a smaller file size. Therefore, I do not think that it will affect the
TOC Linking, but you never know until you try it.


--
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 altered the lines for the file names and now they don't have the
docx in front of them. However, the first file, which was exporting
without the docx previously, is cutting off part of the merged file
name now. Not a huge deal since it's only one file and I know it will
always be the first in the list, but something to note.

I turned off the UseISO19005_1 option (False) and adjusted the
formatting of the cover page. This seems to have kept the formatting
as I want it (no color changes or type changes, etc). I have not been
able to figure out how to get the ToC to link, but at least there are
bookmarks in the PDF!

I tried to change the OptimizeFor:=wdExportOptimizeForPrint option
since we're screen viewing these only, but I couldn't figure out what
option should be for screen optimization.

Thank you,
Jessica

On Aug 6, 12:19 am, "Graham Mayor" wrote:
The current version of the add-in available for download from my web site
is
Version 31. This one (and version 28) print to the AdobePDF driver and
thus
require Acrobat installed. The only changes you can make to the settings
are
those in the printer driver. It does not use the Acrobat add-in with its
extra functionality.

The later versions of the Splitmerge add-in include a macro to create a
template to use for the merge when the merge document template is not
available - presumably you have the merge document template - and use the
merge document template when it is available, but the normal template if
it
is not available. Using the normal template can produce formatting
anomalies
if the merge document was based on some other template.

The additional version (32) linked to this thread is not fully developed
and
uses the SaveAsPDFandXPS.exe add-in. This PDF add-in does not have any
Ribbon commands. It adds an option to the Save As menu.(PDF or XPS) and if
you select the PDF option, the dialog has an options button. (32) is
configured to save with 'Document structure tags for accessibilty' and ISO
19005-1 compliance checked, but it would be simple enough to change that.
You will find the relevant code:

If MakePDF = True Then
If Application.Version 12 Then
NewDoc.PrintOut Background:=False
Else
NewDoc.ExportAsFixedFormat OutputFileName:= _
FldrPath & fnames(i) & ".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:=True
End If
End If.

in the
Private Sub app_MailMergeAfterMerge(ByVal Doc As Document, ByVal DocResult
As Document)
code which you will find in the Merge Application class module.

In order to remove the docx. part of the filename, you can start by
changing
the above section of code to:

If MakePDF = True Then
If Application.Version 12 Then
NewDoc.PrintOut Background:=False
Else
NewDoc.ExportAsFixedFormat OutputFileName:= _
Left(FldrPath & fnames(i), _
Len(FldrPath & fnames(i)) - 5) & ".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:=True
End If
End If

If you find the right combination of Microsoft PDF parameters to give you
the results you require, then please let me know, either by this thread or
to my web site and I will ad the changes to the live version of the
add-in.
--

Graham Mayor - Word MVP

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


Divinite wrote:
I've exported the doc straight to PDF without doing the merge and all
graphics have appeared correctly. This was using, at separate times,
the Acrobat ribbon "Create PDF" and the print dialog. The last
version of the plug-in I was using (28) exported all graphics
correctly. I'm not sure how to get it to specifically print using the
Word add-in for PDF. There was no place to select the Word add-in for
PDF. I'm using Acrobat 9 (although I also exported it on ver 8), with
standard settings. The only thing I changed was to unclick the "Show
PDF result" and "Prompt for filename" options.


I installed the file SaveAsPDFandXPS.exe and it said it was
successful. It's not showing up anywhere (in the macro list or on the
add-ins ribbon). Since I can't find it, I don't know where the
settings would be. Where should it be?


After installing the revised add-in the file name for the first one
was file1.pdf and from there on out they were file2.docx.pdf. I
removed my old version of the add-in, but I did leave the last version
of the exports in the same export folder. While it's possible to
change the file names, the issue for us comes in distribution of our
reports since we're not printing them. We're sending out reports to
1500 people, mail merging in the filenames to a download location.
They'll be on print letters and going to people that are not the most
tech savvy, so it's important to us that the file names are very
simple. Needless to say, with 550 customized reports among this group
of people, that's a bit too many files to rename. It wouldn't be an
issue except the client specifically requested bookmark functionality.


If the ToC links don't show up, that's not a killer for me. I don't
think I can figure out VB code (at least in the short amount of time I
have for this project) and it's not that important as long as they
exist in the PDF.


Thank you,
Jessica


On Aug 4, 11:34 pm, "Graham Mayor" wrote:
While I agree with Doug, have you tried simply exporting the
document to PDF using the Word add-in (without for the moment
worrying about the merge). Are there any settings of the PDF options
that reproduce the graphics in your document correctly? If so the
options can be changed in the add-in.


When you say that it did not include docx in the first merge, do you
mean after installing the revised add-in? If so did you remove the
original add-in first?


While it would be possible to change the filename to remove docx
from the PDF name, I don't feel inclined to do so for a one off that
does not even provide the functionality required to print your
document (which is also why this version of the add-in has not
replaced the add-in available to download normally from my web site).


--

Graham Mayor - Word MVP


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


Divinite wrote:
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


...

read more »