Consulting

Results 1 to 2 of 2

Thread: sending tasks from an other account

  1. #1

    sending tasks from an other account

    I'm developping an Access 2003 application to register tasks/jobs. In addition I want the app to send a task to a collegae from a central mailbox (I have full access to this mailbox) in stead of my own mailbox.

    The problem I have to solve is that the tasks are being send from my own mailbox.

    the code I'm using:

    Option Compare Database
    Option Explicit
    Function makeTask()
    Dim OutlookApp As Outlook.Application
    Dim outlookTask As Outlook.TaskItem

    Set OutlookApp = CreateObject("Outlook.Application")
    Set outlookTask = OutlookApp.CreateItem(olTaskItem)
    With outlookTask
    .Recipients.Add (getEMail)
    .Owner = "nameOfMailbox"
    .subject = getSubject
    .Body = getOmschrijving
    .ReminderSet = False
    .DueDate = getDateEnd
    .Assign
    .Save
    .Display
    End With
    Debug.Print outlookTask.DelegationState
    End Function


    Does anybody know how to save the task in the central mailbox and send it from this mailbox?

  2. #2
    VBAX Expert JP2112's Avatar
    Joined
    Oct 2008
    Location
    Astoria, NY
    Posts
    590
    Location
    Sorry if this reply is late.

    CreateItem will always create the item in the default folder for that item. To create an item in a non-default folder, you need to walk the folder hierarchy and use MAPIFolder.Items.Add to create a new item in that folder.

    I'm not sure if that will solve your problem about sending the task from your mailbox, however. You may need to logon to your Outlook session as the user you want the task to be sent from.
    Regards,
    JP

    Read the FAQ
    Getting free help on the web
    My website
    Please use [vba][/vba] tags when posting code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •