Consulting

Results 1 to 6 of 6

Thread: Capturing a text and putting at Send To

  1. #1
    VBAX Newbie
    Joined
    Sep 2011
    Posts
    3
    Location

    Capturing a text and putting at Send To

    Hi everybody. I need some help for creating a macro for Outlook. I'm not familiarized with VBA, so, I ask you people to explain in a very easily way, ok?

    I have form being recieved from my website to my email.
    I need that when I click to answer that message to the sender, the macro capture the field "email" from the body message and apply automatically that email to the "To:" field.

    I know that I could program my own script of my website, to send the form for me, using the same email that the person writted. But my host blocks that script usage. So, the only sollution I could find is to create that macro in the Outlook.

    Waiting for an answer, thank you.

  2. #2
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    Can you show an example of such an email (layout).

    Charlize

  3. #3
    VBAX Newbie
    Joined
    Sep 2011
    Posts
    3
    Location

    Thumbs up

    Quote Originally Posted by Charlize
    Can you show an example of such an email (layout).

    Charlize
    Sure. It looks like this:

    Choose Area: Orientation
    Name: John B. Johnson
    Address: 1st avenue
    District: Ipiranga
    PO Box: 123456789
    City: New York
    State: AB
    Email: email@example.com
    Telephone: 555-456789
    Celphone: 555-456789
    Message: My message.

  4. #4
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    Try this one to start. Select one message and run this macro. It will display a popup with the, I hope, desired address you need.
    [VBA]Sub Get_Address_From_Current_mail()
    Dim mymessage As Outlook.MailItem
    Dim thebody As String
    Set mymessage = ActiveExplorer.Selection.Item(1)
    thebody = mymessage.Body
    MsgBox Split(Split(Mid(thebody, InStr(1, thebody, "Email: ") + 7, _
    InStr(InStr(1, thebody, "Email: "), thebody, vbCrLf) - _
    InStr(1, thebody, "Email: ") - 7), """")(1), ":")(1)
    End Sub[/VBA]Charlize

  5. #5
    VBAX Newbie
    Joined
    Sep 2011
    Posts
    3
    Location
    Quote Originally Posted by Charlize
    Try this one to start. Select one message and run this macro. It will display a popup with the, I hope, desired address you need.
    [VBA]Sub Get_Address_From_Current_mail()
    Dim mymessage As Outlook.MailItem
    Dim thebody As String
    Set mymessage = ActiveExplorer.Selection.Item(1)
    thebody = mymessage.Body
    MsgBox Split(Split(Mid(thebody, InStr(1, thebody, "Email: ") + 7, _
    InStr(InStr(1, thebody, "Email: "), thebody, vbCrLf) - _
    InStr(1, thebody, "Email: ") - 7), """")(1), ":")(1)
    End Sub[/VBA]Charlize
    I can't find an option to run the macro inside the email. I use Outlook Express and 2007.

  6. #6
    VBAX Expert JP2112's Avatar
    Joined
    Oct 2008
    Location
    Astoria, NY
    Posts
    590
    Location
    Outlook Express (OE) does not support VBA. OE is a part of Windows, while Outlook is part of the Microsoft Office Suite.
    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
  •