Scan / Update Uncompleted Tasks

K

KitCaz

Hi there!

I'm having an issue with my phone and it's interface with my tasks, it's
deleting my reminders.

So until that's resolved I want to stop the bleeding. I'm reasonably good
at VBA in Access but not Outlook, so I need a little help. My goal:

On opening Outlook, I'd like a VBA procedure to scan all of my non-completed
Tasks, updating the Reminder Date from the Due Date (Due Date not being
compromised).

I've Googled myself silly but all the code snippets I find are a shade too
fragmented for me to plug them in. Anyone have a VBA bone they can throw me?

Chris
 
M

Michael Bauer [MVP - Outlook]

Your function must be called from the Application_Startup event, which is
called by Outlook at startup.

See the GetDefaultFolder function to get a reference to your default task
folder. The returned folder object has an Items collection, through which
you can loop. Then for each TaskItem object set its ReminderTime =DueDate,
and ReminderSet=True, then call Save.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Mon, 21 Sep 2009 13:23:01 -0700 schrieb KitCaz:
 
K

KitCaz

Michael, thank you.

So I opened Outlook, pressed F11 to reveal the VB, expanded Microsoft Office
Outlook, selected ThisOutlookSession, then created this sub, just to see if I
was on the right track, saved, closed OL, and reopened, but didn't see any
msg box. What am I doing wrong?:

Private Sub Application_Startup()

Dim ol As New Outlook.Application
Dim olns As Outlook.NameSpace

MsgBox olns.GetDefaultFolder(olFolderTasks).Name

End Sub
 
M

Michael Bauer [MVP - Outlook]

Don't create a new instance of Outlook as it is already running, instead use
the available Application object. Then, you have forgotten to set the olns
variable to anything. This should work:

Private Sub Application_Startup()

Dim olns As Outlook.NameSpace
set olns=Application.Session
MsgBox olns.GetDefaultFolder(olFolderTasks).Name

End Sub

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Tue, 22 Sep 2009 08:43:02 -0700 schrieb KitCaz:
 
K

KitCaz

Thanks in advance for your patience. So if I applied the change you
mentioned, why don't I get a msgbox pop up on startup? This is what I have:

Private Sub Application_Startup()

Dim olns As Outlook.NameSpace
Set olns = Application.Session
MsgBox olns.GetDefaultFolder(olFolderTasks).Name

End Sub
 
M

Michael Bauer [MVP - Outlook]

Check your security settings, probably VBA isn't running at all:
Tools/Macros/Security.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Mon, 28 Sep 2009 07:49:01 -0700 schrieb KitCaz:
 
K

KitCaz

OK, this helps. My setting was "warning for signed macros, all unsigned
macros are disabled". I changed it to "No security check..." and it worked.
We have an institution-level macro that runs on Send, but I guess it's
"signed".

I'll keep plugging along! Thanks in advance for future answers :).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top