Results 1 to 8 of 8
  1. #1
    Star Lounger
    Join Date
    Sep 2002
    Location
    Detroit, Michigan, USA
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Outlook97/Word97 VBA (Office97/Win2000)

    Using automation to control an Outlook session, how would you select/deselect Word as your e-mail editor on the fly ? My code seems to run if I deselect Word but hangs if the user was using Word as the e-mail editor

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook97/Word97 VBA (Office97/Win2000)

    Do not copy libraries.
    THere's links in them there hills, ooops, I mean the REgistry, and things may get all screwed up wen there are upgrades to software.

    In any case, you have to explicitly set project references. The REgistry knows where each lib lives.

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Outlook97/Word97 VBA (Office97/Win2000)

    What if... you were to pretend that the Outlook DLL (if it's only one?!) were a third party DLL, and you were to explicitly Declare each function you used? In theory, you should then be able to work off a copy that hasn't been registered in the Registry. I can't think of any obvious reason why not, copyright notwithstanding, unless there is some deep fundamental difference between a DLL that is meant to be accessed as a COM object and any other DLL. What do you think?

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Outlook97/Word97 VBA (Office97/Win2000)

    > Using automation to control an Outlook session, how would you select/deselect Word as your e-mail editor on the fly?

    I'm not sure you can do this. According to Microsoft Knowledge Base Article - Q168095, OL97: How to Automate Outlook from Another Program:
    <UL>"The Outlook object model provides all of the functionality necessary to manipulate data stored in Outlook folders. However, there is limited functionality available to control Outlook itself. For example, there is no programming method to change the Options settings on the Tools menu, in Outlook via the object model."[/list]If you could *detect* which was the editor, perhaps you could code around this problem?

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook97/Word97 VBA (Office97/Win2000)

    Problems will occur when there are software updates.
    You'd have several versions of the critter floating around.

    At least with .NET, DLL HELL is eliminated.

  6. #6
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook97/Word97 VBA (Office97/Win2000)

    Shhhh, here's a secret!

    You can access the options setting, referencing the Controls collection in outlook.
    Likely find an example at Sue Mosher's great web site http://www.slipstick.com.

    P.S. Sue's Outlook 2002 VBA book is due out this month.

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Outlook97/Word97 VBA (Office97/Win2000)

    Sue's page on VBA (VB and VBA in Outlook/Exchange Development) didn't seem to have a speciflc example on this. The main developer page (Microsoft Outlook Development Technologies) features a daunting array of links... too many for me to drill through.

    The Outlook 2000 object model doesn't have a top level Controls collection, and there don't appear to be any Controls properties to use to obtain such a collection. Is this an XP thing, or were you thinking of using CommandBarControls? If so, can you explain (or post a link to a demo on) how to drill down to a checkbox on the third tab of the Options... dialog? That would be immensely useful, but just doesn't seem to fall within the realm of the CommandBars object model. Unless you were planning to combine it with SendKeys...

  8. #8
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook97/Word97 VBA (Office97/Win2000)

    I speak in shorthand.

    ' Set object for Outlook Tools menu
    Set cbrOutlookTools = appOutlook.ActiveExplorer.CommandBars.ActiveMenuBa r.Controls("Tools")
    ' Set object for Send item on Outlook Tools menu
    Set cbrOutlookToolsSend = cbrOutlookTools.Controls("Send")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •