Sign in to follow this  
Followers 0
bobbinmp

Outlook Addin button not working

13 posts in this topic

Hi Friends

I have a outlook addin project. This addin create a button with the id "archivebutton"  at the mail ribbon. When i click on that button, it will open a window form. I need to do this with autoit. Below is code that i have done.

#include <MsgBoxConstants.au3>

;open outlook
ShellExecute("OUTLOOK.EXE")

WinWaitActive("Inbox")

Sleep(1000)
Local $archiveBtn = WinGetHandle("Inbox")
MsgBox(64,"Test",$archiveBtn)
Local $Btn = ControlGetHandle($archiveBtn, "", "archivebutton")
;ControlFocus($archiveBtn, "", "[NAME:archivebutton]")

ControlClick($archiveBtn, "", $Btn)

The above code is not working. Can any one direct me why its not working?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Welcome to AutoIt and the forum!

Why do you need to automate the GUI? Can't you use the Outlook COM interface?

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I need to add the automated testing in my add in project. I already have the outlook add in project.

Share this post


Link to post
Share on other sites

Maybe >this thread has what you are looking for.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Actually I need only to open a outlook and click on my button. Can you show me an example here. The link that u given is checked, but i didnt understand it.

Share this post


Link to post
Share on other sites

Then you need to describe in detail what you mean by: "The above code is not working."

Is Outlook started?

Does the script hang or end without any processing?

Etc., etc.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Yes, the above code just start the outlook and the below code will display this text "0x001003F4"

MsgBox(64,"Test",$archiveBtn)

Share this post


Link to post
Share on other sites

But what doesn't work?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

The below code is not working 

ControlClick($archiveBtn, "", $Btn)

Share this post


Link to post
Share on other sites

What's the returnvalue of Controlclick?

$iValue = ControlClick($archiveBtn, "", $Btn)
MsgBox(0, "", $iValue)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

The return value is showing "1"

Share this post


Link to post
Share on other sites

No one know the issue that i posted

Share this post


Link to post
Share on other sites

You need to be patient - this isn't a 24 hours support forum.

If someone has a solution he will post here.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0