locked
Subscribing to events through Access PIA RRS feed

  • Question

  • I am a developer with lots of experience scripting within Office 2003 (Especially Word, Access, and Outlook).

    In 2003 I have had dificulty subscribing to events within MS Access (such as a command button's click event) from within an assembly using the PIAs. Has this capability been improved in 2007/10/13?

    Alternately, is there a better way to go about this in 2007/10/13?

    Jacob

    Monday, December 31, 2012 7:19 PM

All replies

  • Do I understand correctly that you're trying to connect to say a click event from OUTSIDE of Access?

    peter n roth - http://PNR1.com, Maybe some useful stuff

    Tuesday, January 1, 2013 1:39 AM
  • That's not as weird as it sounds, because Access supports OLE and it supports subscribing to events. It's what the WithEvents keyword is for.

    As far as doing this from the .NET world, I am not sure what the PIAs have to do with anything. I'm hoping others can chime in on that.


    -Tom. Microsoft Access MVP

    Tuesday, January 1, 2013 1:44 AM
  • Check out this KB article: http://support.microsoft.com/kb/301982


    -Tom. Microsoft Access MVP

    Tuesday, January 1, 2013 10:15 PM
  • Peter: "Do I understand correctly that you're trying to connect to say a click event from OUTSIDE of Access?"

    Yes exactly.

    Tom,
       The article you linked does deal with using .Net to automate Excel (which is similar to Access). However, that example program doesn't respond to events in any Office objects, which is what I am trying to do.

    Jacob

    Wednesday, January 2, 2013 3:12 PM
  • Hello Jacob,

    The following article explains how to add a command bar button and subscribe to its click event by automating Excel. This may give an idea on how to subscribe for an event.

    http://support.microsoft.com/kb/303017

    From Office 2007 onwards, Office applications have ribbon controls for which we can subscribe to the events by using Ribbon Extensibility. However, this can be done via an Add-in not through automation.

    If you still face the issue, let me know which code you use to subscribe to the event.

    Thanks,

    Sreerenj G Nair

    Tuesday, January 8, 2013 5:24 PM