#1
|
|||
|
|||
DocumentBeforeSave Event doesn't apply to all exports to PDF
Hi, I have an issue with the DocumentBeforeSave event in Word 2007. The event fires correctly about 99% of the time but it's the 1% I'm concerned about. The issue arises when the user of the document clicks on the Office Button, hovers over the "Save As" menu item and then clicks on "PDF or XPS". When they do this, the DocumentBeforeSave event doesn't fire. If the user clicks on "Save As" and then selects PDF from the file type drop down list, the DocumentBeforeSave event fires without any problems. Has anyone encountered this before? Is there a workaround? Please let me know. Your help would be much appreciated!
|
#2
|
||||
|
||||
I don't have a good answer for this problem but I do have some ramblings that might help.
To me that appears to be a document export event rather than a document save event so I'm not altogether surprised that the event doesn't get trapped by documentbeforesave. For instance, if the document is in a saved state and I make some changes and click that button and follow it through to completion, the resulting PDF has those changes but I can see the Word document is unsaved. Recording the step tells me I've run ExportAsFixedFormat. It might be possible to handle that particular pathway by intercepting the built-in command but I couldn't find a likely contender for this. Another alternative may be to edit the ribbon to either hide that button (FileSaveAsPdfOrXps) or replace it with one of your own.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Guessed is right.
Checking under the entries when you select Word Commands in the Macros in: control of the Macros dialog, there does not appear to be an item that you can use to intercept that command. As a result, probably the best thing to do is modify the Ribbon or the File BackStage view so that it contains a custom button that uses the ExportAsFixedFormat command to save the file as a pdf and also provides the option to save the a copy of the pdf to another folder. See my: http://gregmaxey.com/word_tip_pages/customize_ribbon_main.html |
#4
|
|||
|
|||
Thank you both for your replies. I figured I might need to alter the ribbon or office button options but I was hoping that wouldn't be the case! Oh well, I will get started on it. Thanks again!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
File beforeSave Event | Megazoid | Word VBA | 3 | 09-14-2014 01:41 AM |
Hyperlinks in Calendar Event? | komobu | Outlook | 0 | 07-16-2014 08:09 AM |
NEWB to Macros - formatting exports | EC37 | Excel Programming | 52 | 06-25-2014 06:26 AM |
Workbook_Open event do not working? | beginner | Excel Programming | 8 | 04-11-2013 02:37 PM |
Catch event before next slide | PetLahev | PowerPoint | 0 | 10-21-2011 03:29 AM |