Jump to content

Help with Outlook Automation via Controls


Recommended Posts

I am trying to create some Outlook 2003 automations for testing purposes, but I'm stumped on trying to access some navigation features.

In Outlook 2003, there is a navigation pane that allows you to browse your mailbox, PST's Calendar etc. On the bottom of that, there is a toolbar-like object with buttons to go to Calendar view or Mail view etc.

The whole navigation pane is one control, and when I use AutoIt Window Info hover over different sections of it with the mouse, nothing changes except the co-ordinates.

I'm really loath to use coordinates and mouseclicks to access these buttons. Any ideas on how I can expose how to activate certain subcontrols on the navigation pane control, or otherwise activate these buttons without using coordinate driven mouseclicks?

Below is a sample of the Window Info while hovering over the Navigation Pane in case I'm just missing something:

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<
Title:  Inbox - Microsoft Outlook
Class:  rctrl_renwnd32
Size:   X: -4   Y: -4   W: 1032 H: 746

>>>>>>>>>>> Mouse Details <<<<<<<<<<<
Screen: X: 40   Y: 686
Cursor ID:  2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<
RGB:    Hex: 0xC0D8F8   Dec: 12638456

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<
Size:       X: 3    Y: 53   W: 230  H: 634
Control ID: 
ClassNameNN:    NetUIHWND1
Text:       
Style:      0x56000000
ExStyle:        0x00000000

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<
(1): 2 Items
(2): 
(3): 

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<
MsoDockTop
Custom 1
Standard
Type a contact to find
Menu Bar
Type a question for help
WunderBar
NUIDocumentWindow
2 Items
Table View


>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<
MsoDockLeft
MsoDockRight
MsoDockBottom
Cc:
DAL=on

Thanks

Ravenlark-----------------------------------------------------when you find yourself with the majority, its time to pause and reflect - Mark Twain

Link to comment
Share on other sites

  • Moderators

Most use Objects here for Outlook, I know cameronsdad along with others have posted some examples.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Most use Objects here for Outlook, I know cameronsdad along with others have posted some examples.

Thats for the suggestions and the links guys. I considered COM, but I would rather not use it.

The scripts intended purpose it to replace manual compatibility testing when new patches / software is applied to our image. If I can use control clicks, send keys etc along with various logging mechanisms I think I can accurately mimic out manual testing procedure.

As a result, its not so much a matter of getting the button clicked, as finding out what happens when someone clicks the button if that makes sense, so doing things with COM does not fully represent and accurate picture of the action.

Any other thoughts than COM?

Thanks again

Ravenlark-----------------------------------------------------when you find yourself with the majority, its time to pause and reflect - Mark Twain

Link to comment
Share on other sites

...its not so much a matter of getting the button clicked, as finding out what happens when someone clicks the button...

Sounds like fun... not.

All I can think of is working with a known set of e-mails and calendar appointments. For the email tests, have an e-mail in the inbox with a known subject line and perhaps a color square in the body. Then use PixelCheckSum to "read" the subject line and/or the Pixel... functions to "see" a part of the body. Same principle for the calendar functions.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Sounds like fun... not.

All I can think of is working with a known set of e-mails and calendar appointments. For the email tests, have an e-mail in the inbox with a known subject line and perhaps a color square in the body. Then use PixelCheckSum to "read" the subject line and/or the Pixel... functions to "see" a part of the body. Same principle for the calendar functions.

Thats what I have been using so far (set emails and pixel searches...combining with subsequent text read is a good idea), but I found it less reliable when using the navigation buttons to switch from Calendar to Email views for example.

So let me ask this a different way;

From the OS and Outlooks perspective, is creating a new message by clicking New | Message the same process as doing an object.mail.new or whatever the VBA code would be to create a new blank message?

If all the button is doing is calling the same COM object in the same way I can use it. If its doing it some other way I am out of luck.

Thanks,

Ravenlark-----------------------------------------------------when you find yourself with the majority, its time to pause and reflect - Mark Twain

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...