Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

AutoExec sub and Internet Explorer

Posted on 2005-04-19
6
Medium Priority
?
388 Views
Last Modified: 2011-10-03
Hi,

I need to trap any save event in a Word document. I created a class and registered that class from within one of my VBAMacros.dot file stored in my startup directory as describe in the following link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/off2000/html/wohowApplicationEvents.asp

Autoexec fires fine if I use the plain Word desktop but if it's fired from within a IE window, the Autoexec sub doesn't get fire and my class is not attached.

This could be a security issue but I would like someone's second opinion.

If this is a security issues, do you have any alternatives for the save event?

Thanks,
Boomer
0
Comment
Question by:Boomers
  • 2
  • 2
5 Comments
 
LVL 2

Expert Comment

by:mjwills
ID: 13821836
Have you tried the techniques listed at http://word.mvps.org/FAQs/MacrosVBA/AppClassEvents.htm ?
0
 
LVL 1

Author Comment

by:Boomers
ID: 13823568
This is exactly what I'm doing but if a document is open from within Internet Explorer, the AutoExec sub doesn't get fired. And since the Autoexec is not fired, my oApp_DocumentBeforeSave is not registered and not fired on save.

Something must be fired (like a dll) because our document management software intercept the save event from normal Word and Word within IE.

Boomer
0
 
LVL 2

Expert Comment

by:mjwills
ID: 13830521
How does the document management software work? Add-in? Something else?
0
 
LVL 1

Author Comment

by:Boomers
ID: 13857810
Well,

I finally figured this one out.

I've created a .dll that get's attached to word when word is initialized. By putting the With_Events statement in the .dll, every even from word would run throughout my .dll.

The problem with the VBA code was, as I've mentioned before that the Autoexec sub was getting executed if word was initialized from within an Internet Explorer window.

The .dll does fire the AddinInstance_OnConnection sub from normal word and from IE word.

Thanks,
Patrick
0
 

Accepted Solution

by:
CetusMOD earned 0 total points
ID: 14264898
PAQ'd, 300 points refunded.
CetusMOD
Community Support Moderator
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

576 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question