Jump to content

Recommended Posts

Posted

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?

Posted

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
Posted

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?

Posted

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.

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
×
×
  • Create New...