+ Reply to Thread
Results 1 to 3 of 3

Capture Email Name Or Address

  1. #1
    Registered User
    Join Date
    07-01-2004
    Posts
    21

    Capture Email Name Or Address

    I’d like to capture the recipient’s and sender’s name or email address from an open or just sent email message. I have an excel workbook that opens outlook and attachs the active workbook. In this workbook, I'd like to capture the recipient and sender. I could delay the "attach" coding until the email is addressed and then save the workbook with the email information. Then complete my coding and attach the active workbook. But I need the VBA to capture the recipient and sender name or email address. The sender will be addressing the email, not the VBA coding.

    Any suggestions? Thanks.
    JoJo

  2. #2
    Valued Forum Contributor
    Join Date
    12-16-2004
    Location
    Canada, Quebec
    Posts
    363
    It would help you if you could provide a small sample of your work and what you want to have as a final product.

    Thanks
    Denis
    Denis

    Please always attach the sample workbook without sensitive information when asking for help

    To add a module
    Press Alt + F11 (this is the Visual Basic Environment)
    Insert Menu, select Module
    Past code there
    Close Visual Basic Environment (X)

  3. #3
    Registered User
    Join Date
    07-01-2004
    Posts
    21
    Here’s my VBA so far. It is activated when the email command button is selected by the user.


    Private Sub CMDEMAIL_Click()
    ‘INVOICE NUMBER
    SCT = Worksheets("FORM").Range("I3").Text

    ‘THIS IS THE LAST PERSON TO SAVE THIS WORKBOOK
    Worksheets("THISDBASE").Range("USERNAME1").Value = Environ("UserName")
    Application.Run ("SAVEFORM")
    myworkbook = ActiveWorkbook.FullName

    'EMAIL
    Set myOlApp = CreateObject("Outlook.Application")
    Set MYITEM = myOlApp.CreateItem(olMAILItem)

    MYITEM.Display
    MYITEM.Subject = "FINAL REVIEW – INVOICE # " & SCT

    Set myAttachments = MYITEM.Attachments
    myAttachments.Add myworkbook

    Application.Quit
    END SUB

    At this point, the user addresses the email (sent to) and sends the email.

    I want to put the name or email address of the person or persons this email is ‘sent to’ into the original invoice. This will allow the office manager to review the status of the invoice and determine who it was sent to. If it’s easier to VBA code, the “sent to” information can be placed in a new workbook and then I can copy it to the original invoice form. But I don’t know how to capture the sent to information.

    Thanks.
    JoJo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1