Help with tasks in Outlook.ComObjActive("Outlook.Application")

Get help with using AutoHotkey and its commands and hotkeys
tazzzan33
Posts: 16
Joined: 07 Dec 2017, 12:41

Help with tasks in Outlook.ComObjActive("Outlook.Application")

22 Feb 2018, 13:57

I am trying to create a simple task via AHK. I have most of it working except I cannot set the time for the reminder. I would like the gui to select the data and time then feed it into a task and then save it. First I would like the time to be set then I can move on with the rest of the work. You can read more on the ReminderTime property here: https://msdn.microsoft.com/en-us/vba/outlook-vba/articles/taskitem-remindertime-property-outlook


Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

FanaticGuru
Posts: 1167
Joined: 30 Sep 2013, 22:25

Re: Help with tasks in Outlook.ComObjActive("Outlook.Application")

23 Feb 2018, 00:00

tazzzan33 wrote:I am trying to create a simple task via AHK. I have most of it working except I cannot set the time for the reminder. I would like the gui to select the data and time then feed it into a task and then save it. First I would like the time to be set then I can move on with the rest of the work. You can read more on the ReminderTime property here: https://msdn.microsoft.com/en-us/vba/outlook-vba/articles/taskitem-remindertime-property-outlook


Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Maybe this will help point you in the right direction:

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus

The important thing is that ReminderTime is expecting a string in a specific format. Two strings containing a formatted date cannot simply be added together with something like StartDate+StartTime.

I am sure there are examples on the forum about how to do "date math" to add and subtract dates and times.

I believe ReminderTime is expecting something like this: 11/15/2010 10:00:00 AM

So it is important that you get your string looking like this.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts

AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon

Google Search, Dictionary, Thesaurus - Quickly Get Information from Specific Web Resources

[Function] Timer - Create and Manage Timers
User avatar
kczx3
Posts: 618
Joined: 06 Oct 2015, 21:39

Re: Help with tasks in Outlook.ComObjActive("Outlook.Application")

23 Feb 2018, 21:03

FG, Would you mind explaining the line in your line of code above? I’ve seen similar references to this but I haven’t really understood what it does.

Code: [Select all] [Download] GeSHi © Codebox Plus

Date += Days, Days
FanaticGuru
Posts: 1167
Joined: 30 Sep 2013, 22:25

Re: Help with tasks in Outlook.ComObjActive("Outlook.Application")

24 Feb 2018, 00:12

kczx3 wrote:FG, Would you mind explaining the line in your line of code above? I’ve seen similar references to this but I haven’t really understood what it does.

Code: [Select all] [Download] GeSHi © Codebox Plus

Date += Days, Days


Here is a link to docs:
https://autohotkey.com/docs/commands/EnvAdd.htm

It has the form of:
Var += Value , TimeUnits

In my code:
Date is a variable containing a date-time formatted string.
The first Days is a variable containing an integer like 2.
The second Days is a time unit, in this case Days.

So basically this is saying take the date in Date and add the amount in variable Days, as Days to Date.

The allowed time units to add are Seconds, Minutes, Hours, or Days.

You could also do something like:
X += Y, Hours
This would add Y hours to X.

Or TakeOffTime += 245, Seconds to add 245 seconds to TakeOffTime.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts

AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon

Google Search, Dictionary, Thesaurus - Quickly Get Information from Specific Web Resources

[Function] Timer - Create and Manage Timers
User avatar
kczx3
Posts: 618
Joined: 06 Oct 2015, 21:39

Re: Help with tasks in Outlook.ComObjActive("Outlook.Application")

24 Feb 2018, 20:20

Cool thanks! I think that I’ve really only ever used EnvSub so haven’t had the use for the EnvAdd. Good to know

Return to “Ask For Help”

Who is online

Users browsing this forum: bunam, sn0365 and 90 guests