Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-06-2015, 09:38 AM
ARK275 ARK275 is offline DocumentBeforeSave Event doesn't apply to all exports to PDF Windows 7 64bit DocumentBeforeSave Event doesn't apply to all exports to PDF Office 2007
Novice
DocumentBeforeSave Event doesn't apply to all exports to PDF
 
Join Date: Feb 2015
Posts: 2
ARK275 is on a distinguished road
Default 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!
Reply With Quote
  #2  
Old 02-06-2015, 05:06 PM
Guessed's Avatar
Guessed Guessed is offline DocumentBeforeSave Event doesn't apply to all exports to PDF Windows 7 32bit DocumentBeforeSave Event doesn't apply to all exports to PDF Office 2010 32bit
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,969
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
  #3  
Old 02-07-2015, 08:14 AM
gmaxey gmaxey is offline DocumentBeforeSave Event doesn't apply to all exports to PDF Windows 7 32bit DocumentBeforeSave Event doesn't apply to all exports to PDF Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,428
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

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
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #4  
Old 02-09-2015, 07:06 AM
ARK275 ARK275 is offline DocumentBeforeSave Event doesn't apply to all exports to PDF Windows 7 64bit DocumentBeforeSave Event doesn't apply to all exports to PDF Office 2007
Novice
DocumentBeforeSave Event doesn't apply to all exports to PDF
 
Join Date: Feb 2015
Posts: 2
ARK275 is on a distinguished road
Default

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!
Reply With Quote
Reply



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

Other Forums: Access Forums

All times are GMT -7. The time now is 08:22 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft