Consulting

Results 1 to 4 of 4

Thread: Access/Outlook

  1. #1

    Access/Outlook

    I'm trying to find the code to pull the sender's name from an email sent via access. Each time an email is sent, it is logged into access, indicating who it went to and when. I need to also be able to log who the email was sent from. can anyone get me started on this? everything i have found so far involves incoming emails and not outgoing. thks!

  2. #2
    VBAX Regular
    Joined
    Jul 2004
    Location
    London, UK
    Posts
    15
    Location
    Hey danitrin!

    Try this.. prints username to the immediate window (Ctrl + g to open this in VBA mode)
    [vba]
    Dim objApp As Outlook.Application
    Dim objNS As Outlook.NameSpace
    Set objApp = New Outlook.Application
    Set objNS = objApp.GetNamespace("MAPI")
    Debug.Print objNS.CurrentUser

    'clean up
    Set objApp = Nothing
    Set objNS = Nothing

    Dave :-)
    [/vba]

  3. #3
    That worked perfect.....thank you so much!

  4. #4
    VBAX Regular
    Joined
    Jul 2004
    Location
    London, UK
    Posts
    15
    Location
    glad to help mate!

Posting Permissions

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