Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-27-2024, 01:24 AM
RRB's Avatar
RRB RRB is offline Macro to run anytime any doc is opened Windows 11 Macro to run anytime any doc is opened Office 2021
Susan Flamingo
Macro to run anytime any doc is opened
 
Join Date: May 2014
Location: The Holy City of Jerusalem
Posts: 263
RRB is on a distinguished road
Default Macro to run anytime any doc is opened

Hi friends!

I want a macro to run anytime any doc is opened. I put the following in the normal.dotm:
Sub document_open()



MsgBox "Stay focused!"

With ActiveWindow.View.RevisionsFilter
.Markup = wdRevisionsMarkupNone
end sub
But if the normal.dotm is already open in another doc it doesn't execute when I open another doc. Is there a way to get this to run without adding to every doc itself?

Thank you and have a good day!

Susan Flamingo
Reply With Quote
  #2  
Old 02-27-2024, 02:03 AM
gmaxey gmaxey is offline Macro to run anytime any doc is opened Windows 10 Macro to run anytime any doc is opened Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
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

Put the following in a standard module of the Normal.Template.


Sub AutoOpen()
'Your code here.
End Sub


Note this will only work with documents that has Normal.dotm as the attached template.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 02-27-2024, 02:07 AM
RRB's Avatar
RRB RRB is offline Macro to run anytime any doc is opened Windows 11 Macro to run anytime any doc is opened Office 2021
Susan Flamingo
Macro to run anytime any doc is opened
 
Join Date: May 2014
Location: The Holy City of Jerusalem
Posts: 263
RRB is on a distinguished road
Default

As always work perfectly. Thnk you!!!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot save an opened message Tom McW Outlook 1 05-08-2019 06:44 PM
Macro to run anytime any doc is opened Anytime a section of TOC is updated, the picture stored in that section gets copied into my TOC. brap367 Word 1 12-15-2014 12:49 PM
Help! Can't Get Macro To Work In .docx Opened Off A Website Mhangoy Word VBA 0 08-29-2013 03:02 AM
Macro to run anytime any doc is opened Run Macro anytime new mail message form is opened starrouter Outlook 1 02-24-2013 11:29 AM
Macro to run anytime any doc is opened Who opened it Wascar Word 1 03-01-2012 01:30 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:54 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