Outlook Automation

harrisw

Registered User.
Local time
Today, 20:53
Joined
Mar 27, 2001
Messages
131
I'm trying to create an Outlook task and assign it to someone

I've created the object etc but when I try olNewTask.assign "username" it doesn't work
 
I've attached a very basic database that will do this.
Use it and modify it to what you need.

Kev.
 

Attachments

How to post a task to a public folder?

EntryID: 000000001A447390AA6611CD9BC800AA002FC45A03008E062CC56D76434696DC101D36C9B86F000000AEBDA80000

StoreID: 0000000038A1BB1005E5101AA1BB08002B2A56C20000454D534D44422E444C4C00000000000000001C830210AA6611CD9BC800AA002FC45A060000005641442D43532D50463100D83521F3970000000100000014000000570000002F4F3D4F5247414E495A4154494F4E2F4F553D4D4F4F44592F636E3D436F6E66696775726174696F6E2F636E3D536572766572732F636E3D5641442D43532D504631005600410044002D00430053002D005000460031002E006D006F006F00640079002E006100630063002E00640073002E00610066002E006D0069006C0000000000
 
Also need to use a custom form (already set as default for folder) when posting to this folder.
 
Figured it out...

If you need to post a task to a public folder on an exchange server (and not your default profile folder) you'll need to find out your folder's EntryID and StoreID then use the following code (or edit as needed); also allows custom form usage:

Code:
    Dim txtEntryID
    Dim txtStoreID
    Dim txtFormName
            
    'Retrive task folder EntryID and StoreID
    txtFormName = "Task"
    txtEntryID = DLookup("[EntryID]", "YourTable", "YourRef")
    txtStoreID = DLookup("[StoreID]", "YourTable", "YourRef")

        'Open Outlook
        Set ol = CreateObject("Outlook.Application")
        Set olns = ol.GetNamespace("MAPI")
        
        'Select task management folder
        Set myFolder = olns.GetFolderFromID(txtEntryID, txtStoreID)
        
        'Create task with Munitions Task form
        Set myItem = myFolder.Items.Add("IPM.Task." & txtFormName)
    
            'Save Task with information previously retrieved
            With myItem
                .Subject = Me.TASKDESC
                .STARTDATE = Me.ESTDATESTART
                .Save
            End With
 

Users who are viewing this thread

Back
Top Bottom