Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 11-30-2013, 02:55 PM
macropod's Avatar
macropod macropod is offline Prompt a macro to run when opening a specific file type Windows 7 32bit Prompt a macro to run when opening a specific file type Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,521
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

OK, but your new code doesn't test the document format, (i.e. RTF), which you previously specified as a requirement.

As a side note, your two 'Docname Like' tests could be reduced to:
Code:
If Docname Like "*[Cc]ontract*" Then  Call contractchange
Finally, you'll note that my code passed the document reference from the Document_Open macro to FoodAndBeverageMacro. That ensures that, if you have two or more documents open, only the one that is subject to the Document_Open macro and to which FoodAndBeverageMacro should apply can be processed.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
macros don't work, macros in word, vba word



Similar Threads
Thread Thread Starter Forum Replies Last Post
Prompt a macro to run when opening a specific file type Word file type in 2007 casaserves Word 4 08-03-2013 01:11 AM
Prompt a macro to run when opening a specific file type can I run a macro when I open a specific doc ?? ximpostor Word VBA 10 10-12-2012 12:35 PM
Prompt a macro to run when opening a specific file type Need VBA For Macro On How To Remove Specific Words netchie Word VBA 6 08-28-2012 03:37 PM
can I run a macro when I open a specific doc. shreked Word 8 01-12-2012 03:36 AM
Getting COMException Incompatible file type and file extension sbalerao Mail Merge 0 04-21-2011 10:30 AM

Other Forums: Access Forums

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