Struggling with an AHK / Outlook issue Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
BLoweZero
Posts: 11
Joined: 29 May 2018, 19:42

Struggling with an AHK / Outlook issue

21 Jan 2019, 21:22

I'm using the following code:

Code: Select all

^2::
Send !O
Sleep 200
Send {T}{H}
return
I'm trying to set an Outlook email ultimately to HTML.
If I manually type it in it works perfectly: Alt+O (the letter), then TH, Now this is in an open email.

When I run the code IT pops up Window titled "Mark Table Contents Entry" and puts the TP in the "entry" field.

Now here's the kicker. It works fine if it's set to Plain Text. But if it's already HTML, then it pops up the other intruesive window. There are more actions to run after it's set to HTML. I can't get past this problem to add the other actions to complete the script.

I just need to be sure it is set to HTML before proceeding with the other actions. Anyone dare to tackle this one? I'm totally zonkered by it.

Thanks BLoweZero

Moderator Note: Added code tags. ~ sinkfaze
Attachments
PopUp.PNG
PopUp.PNG (26.5 KiB) Viewed 1114 times
awel20
Posts: 211
Joined: 19 Mar 2018, 14:09

Re: Struggling with an AHK / Outlook issue

22 Jan 2019, 09:43

BLoweZero wrote:
21 Jan 2019, 21:22
send !O
This sends Alt+Shift+o beacuse the 'O' is uppercase.
Try, send !o
eelrod
Posts: 65
Joined: 10 Apr 2018, 11:17

Re: Struggling with an AHK / Outlook issue

22 Jan 2019, 10:01

I can confirm the doing alt+shift+o brings up the window that BLoweZero mentioned (only when the cursor is in the body), so sending the lower-case o as awel20 mentioned should solve it. Perhaps doing this with COM may be more reliable. Worth a look?

Edit: Added the COM version.

It's untested for errors, like if you're not in the right window, etc. But it seems to work fine for me when I have a new message open.

Code: Select all

^2::
oOutLook := ComObjectActive( "Outlook.Application" )
oOutLook.ActiveInspector.CurrentItem.BodyFormat := 2
oOutLook := ""
Return
BLoweZero
Posts: 11
Joined: 29 May 2018, 19:42

Re: Struggling with an AHK / Outlook issue  Topic is solved

24 Jan 2019, 18:48

The lower case 'o' worked.
Thanks y'all. Great help!
BLoweZero

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: AlFlo and 120 guests