Outlook, VBA Task Item, Problem with Shared Folder

C

Cyrill Häfeli

Hello Peoples

I have a Problem in VBA in MS Outlook
I want create a TaskItem in a Shared Folder, i need help.


This is My Code Now:

Dim ol As Object
Dim olns As Object
Dim objfolder As Object
Dim items As outlook.TaskItem
Dim item As Object
Dim txtFällig As Date

Set ol = New outlook.Application
Set olns = ol.GetNamespace("MAPI")
Set objfolder = olns.Folders("Öffentliche Ordner").Folders("Alle Öffentlichen Ordner").Folders("GD")
Set items = ol.CreateItem(olTaskItem)

With items

.Subject = txtAuftrag
.DueDate = txtFällig
.StartDate = Date
.Save
End With
 
S

Sue Mosher [MVP]

Instead of CreateItem, use objFolder.Items.Add.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.slipstick.com/books/jumpstart.htm


Hello Peoples

I have a Problem in VBA in MS Outlook
I want create a TaskItem in a Shared Folder, i need help.


This is My Code Now:

Dim ol As Object
Dim olns As Object
Dim objfolder As Object
Dim items As outlook.TaskItem
Dim item As Object
Dim txtFällig As Date

Set ol = New outlook.Application
Set olns = ol.GetNamespace("MAPI")
Set objfolder = olns.Folders("Öffentliche Ordner").Folders("Alle Öffentlichen Ordner").Folders("GD")
Set items = ol.CreateItem(olTaskItem)

With items

.Subject = txtAuftrag
.DueDate = txtFällig
.StartDate = Date
.Save
End With
 

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