Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 08-06-2020, 08:21 AM
gmaxey gmaxey is offline Document before save macro? Windows 10 Document before save macro? Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

You could set up a Application Event Monitor as a class in your Normal Template.


Add a new class module. Call it csAppMonitor and paste in the following code:
:
Code:
Option Explicit
Public WithEvents oAddInMontiorApp As Word.Application

Private Sub Class_Initialize()
  Set oAddInMontiorApp = Word.Application
End Sub

Private Sub oAddInMontiorApp_DocumentBeforeSave(ByVal Doc As Document, SaveAsUI As Boolean, Cancel As Boolean)
  MsgBox "Beep"
End Sub

In a standard module of your Normal.dtom, Declare:
Public oMonitor As clsAppMonitor



Then in the AutoExec sub
Set oMonitor = New clsAppMonitor
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Document before save macro? Macro to save Word 2007 document using info from Quick Parts staicumihai Word VBA 2 08-08-2018 01:21 AM
Cant save document as docx or doc using macro in Word 2007 staicumihai Word VBA 1 04-27-2018 10:59 AM
Document before save macro? Tweak Macro to Save Each Page of Word Document as Separate PDF or Doc File? Hewg74 Word VBA 3 08-22-2016 05:20 PM
Save As Macro using first line of document as document name redzan Word VBA 1 01-31-2015 09:24 PM
Document before save macro? How to save a macro in a document generated with a word model? Cristin7 Word VBA 4 03-25-2014 03:25 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:53 AM.


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