Jump to content
Sign in to follow this  
eyc

ControlSend Not Working for Control Class _WwG

Recommended Posts

eyc

i'm trying to use ControlSend to write text to the notes section of an outlook 2007 journal entry. it doesn't seem to work though. i open a new outlook journal entry and execute this script:

ControlSend ("Untitled - Journal Entry", "", "[CLASS:_WwG; INSTANCE:1]", "hello")

does anybody happen to know what is wrong?

Share this post


Link to post
Share on other sites
eyc

anybody know what is wrong?

Share this post


Link to post
Share on other sites
PsaltyDS

Don't have that version of the app to test. First thing to verify is that you are addressing the control successfully:

$hWin = WinGetHandle("[Title:Untitled - Journal Entry]", "")
If IsHWnd($hWin) Then
    ConsoleWrite("Debug: $hWin = " & $hWin & @LF)
    $hCtrl = ControlGetHandle($hWin, "", "[CLASS:_WwG; INSTANCE:1]")
    If IsHWnd($hCtrl) Then
        ConsoleWrite("Debug: $hCtrl = " & $hCtrl & @LF)
        ControlFocus($hWin, "", $hCtrl)
        ControlSend($hWin, "", $hCtrl, "hello")
        ConsoleWrite("Debug: Attempted ControlSend()" & @LF)
    Else
        ConsoleWrite("Debug: Error, failed to get control handle." & @LF)
    EndIf
Else
    ConsoleWrite("Debug: Error, failed to get window handle." & @LF)
EndIf

There is also a COM automation UDF for Outlook floating around in Example Scripts that might be usable.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
eyc

i tried running your autoIt code, but it doesn't seem to have done anything. do i need to do anything special to enable consolewrite output?

Share this post


Link to post
Share on other sites
Blue_Drache

yep. Use the SciTE editor.


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites
eyc

it worked! i wonder why it didn't work the first time i ran it. oh well. i'm happy.

thanks for the tip on consolewrite. i was executing my scripts by double-clicking on them and so i didn't see any console output. i didn't realize there was an output pane feature in the scite editor in which consolewrite output appears when i run my script by pressing F5. cool. this is much better than using msgbox to debug with.

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  

×