Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Outlook Mail using Access (AXP / WIN2K)

    I am sending a mail message from Access when a certain event occurs. What if I want the mail to come from a different mailbox, say one that the user has full permissions on. Is there a way to do this? The whole story is that I want the mail to come from a general mailbox and not the persons personal mailbox.

    Thanks,
    Mark

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Outlook Mail using Access (AXP / WIN2K)

    As far as I know, there is no "general" mailbox for Outlook or Exchange. You could set up a special mail account in Exchange and build an Outlook profile to use that mailbox, but I'm not sure how well it would work.
    Charlotte

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Outlook Mail using Access (AXP / WIN2K)

    If the person has multiple profiles configured in Corporate Workgroup mode, you can code your logon this way, more or less:

    Dim olApp As Outlook.Application, olNameSpace As Outlook.NameSpace
    On Error Resume Next
    Set olApp = GetObject(, "Outlook.Application")
    If Err.Number = 429 Then 'Outlook was not open...
    Set olApp = CreateObject("Outlook.Application")
    End If
    On Error GoTo 0
    Set olNameSpace = olApp.GetNamespace("MAPI")
    olNameSpace.Logon ProfileName, PasswordIfAny, blnShowDialog, False

  4. #4
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook Mail using Access (AXP / WIN2K)

    Thanks Everybody,
    So in this case, a person could actually log on as a different profile for only this occurrence of the mail being sent? That sounds as if it will work. I will try that to see what happens.

    Thanks,
    Mark

  5. #5
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook Mail using Access (AXP / WIN2K)

    Well I tried the olnamespace.logon line but that didn't work. Here is what I have:

    Dim apOL1 As Outlook.Application, nmspOL1 As Outlook.NameSpace
    Dim itmMsg1 As Outlook.MailItem, strOutFile1 As String
    Set apOL1 = CreateObject("Outlook.Application")
    Set nmspOL1 = apOL.GetNamespace("MAPI")
    nmspOL1.Logon "fsa",true,true
    Set itmMsg1 = apOL.CreateItem(olMailItem)

    "fsa" is a profile I have setup on my local machine. This profile only looks at the correcct mailbox. Any other ideas?

    Thanks,
    Mark

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Outlook Mail using Access (AXP / WIN2K)

    Which part isn't working: it doesn't log on or it sends the mail only from the person's individual mailbox?

    The profile needs to be set up to send from the mailbox you want to send from. There's no way to change identity programmatically from VBA (although I believe you can send "on behalf of"), it has to be in the profile.

    I don't use Exchange, so if you need help on those parts, try the Outlook board.

Posting Permissions

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