Removing Outlook Warning

L

Lor

Hi,

I am using Outlook 2003 and Access 2000. I try to mark a task as completed
from Access, but there is an Outlook warning that always comes up that I have
to click on "Yes" to allow the procedure to continue. The code is:

Function MarkComplete()

Dim myOlApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myRecipient As Outlook.Recipient
Dim myItem As Outlook.TaskItem
Dim myTask As String

Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myRecipient = myNamespace.CreateRecipient("Jane Smith")
myRecipient.Resolve
myTask = "Subject Name of Task"
Set myItem =
Outlook.Application.Session.GetSharedDefaultFolder(myRecipient,
olFolderTasks).Items(myTask)
myItem.MarkComplete

End Function

Is there an easy way to get around the warning?

Thanks,
Lor
 
D

Dmitry Streblechenko

Do not call myRecipient.Resolve. GetSharedDefaultFolder will syill work just
fine, but there won't be a prompt.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

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