Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2006

Tip: Looking for answers? Try searching our database.

problem with event handling

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
joel - 15 Mar 2006 06:43 GMT
What I am trying to do is to get a section of code to run whenever a specific
document (not a template) is opened (using Word 2003 with WinXP SP2). I have
put the following test event handling code in the 'ThisDocument' object of
the word document's project:

Private Sub Document_Open()
   MsgBox "Opening document"
End Sub

However, when I close the document and open it up again, the code doesn't
appear to execute i.e. the message box doesn't display. Does this event
handling work with documents that aren't templates? Is there something I'm
missing?

Thanks in advance for your help
Jonathan West - 15 Mar 2006 12:34 GMT
> What I am trying to do is to get a section of code to run whenever a
> specific
[quoted text clipped - 13 lines]
>
> Thanks in advance for your help

Which version of Word are you running?
What are your security settings? (go to Tools, Macro, Security) to find out.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org 

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.