+ Reply to Thread
Results 1 to 13 of 13

Search Email And Add Reply To It

  1. #1
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Search Email And Add Reply To It

    Hello again,

    I have adopted and make changes to the below script according to my needs. But I got struck on adding reply to body of the email.

    What I am trying to search outlook for specific string (Which is mentioned in worksheet cell value in body of the email and open that email on reply/replyall mode and add new reply to that email.

    Below is the email which I need expert help please.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Search Email And Add Reply To It

    Try this...

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 02-22-2014 at 12:41 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Search Email And Add Reply To It

    Thanks for replying Alpha,

    Now I am getting error on Next:

    Run-time error '13':
    Type mismatch

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Search Email And Add Reply To It

    Really on Next? I wouldn't expect it to error there. Maybe somewhere else.

    It worked for me. Are you using the exact code I posted, or did you modify it at all?

  5. #5
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Search Email And Add Reply To It

    I am using exactly what you suggested Copy and paste

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Search Email And Add Reply To It

    I don't know what to tell you. I can't get mine to error.

    This was the key change if you want to add it to your original code...
    Please Login or Register  to view this content.
    What's the value in ActiveSheet.Range("A1")

  7. #7
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Search Email And Add Reply To It

    Alphanumeric value like AFG223043 or 20993 or branch. It can be 3 formatted text like alphanumeric, numbers only or text only

  8. #8
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Search Email And Add Reply To It

    As a test, change the type of olMail to variant.

    Dim olMail As Variant

  9. #9
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Search Email And Add Reply To It

    by changing it works but it is removing original message which should be below to this reply. It is showing the reply which is in the script. I."Replying Message to email".

    Any idea about this issue please.

  10. #10
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Search Email And Add Reply To It

    Try this...

    Please Login or Register  to view this content.

  11. #11
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Search Email And Add Reply To It

    Thanks Alpha.

    It is displaying the original message but changed the format like company logo, Facebook & Twitter icon is converted into link and disclaimer is not showing. If you can help to resolve this I will be very thankful to you otherwise I will marked this thread is solved.

  12. #12
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Search Email And Add Reply To It

    Try this...

    .HTMLBody = "Replying Message to email" & "<br><br>" & .HTMLBody

    The body of the message is HTML format.

  13. #13
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Cool Re: Search Email And Add Reply To It

    Thanks AlphaFrog for your valuable help and guess what it really works as I want. God bless you.

    Final script is below if any other staff need it.

    Please Login or Register  to view this content.
    Reputation added and topic marked as solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] search button with reply sentence
    By julieta in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-17-2014, 05:24 AM
  2. [SOLVED] Reply ALL email from excel Range will not CC or Bcc original recipients
    By sonny.thind in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2013, 09:32 AM
  3. Using Excel VBA Macro to Reply to email in Outlook
    By thechancellor in forum Excel General
    Replies: 0
    Last Post: 06-19-2012, 09:40 PM
  4. [SOLVED] Reply to outlook email from excel script
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-21-2006, 12:00 PM
  5. control outlook to reply to email
    By as_sass in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-04-2005, 05:32 PM

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