Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to access user defined fields in Outlook via VBA ?

Status
Not open for further replies.

pharcyder

Programmer
Mar 12, 2002
66
DE

Hi,

I added some fields to an olTaskItem and saved it for use with my Tasks.

Now I want to import data from a database and fill these Tasks, but *how* can I access my new fields ?

Here's a snippet of the code used for filling "normal" task items:
[tt]
.
.
.
'rs is my opened recordset

Dim olApp As Outlook.Application
Set olApp = CreateObject("Outlook.Application")
Dim olNs As Outlook.NameSpace
Set olNs = olApp.GetNamespace("MAPI")
Dim olTask As Outlook.TaskItem

Set olTask = olApp.CreateItem(olTaskItem)

With olTask
.StartDate = rs("Datum")
.Subject = rs("Subject")
.NewField = rs("SomeData")
'^and *this* is not working, 'cause the "olTaskItem" don't have my field, but how can I access them ??
End With

olTask.save
set olTask = Nothing
.
.
.
[/tt]

Now how can I open and fill *my* TaskItem which I created ?

Thanks in advance,
Jens K.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top