+ Reply to Thread
Results 1 to 11 of 11

Outlook VBA Wildcard

  1. #1
    Registered User
    Join Date
    10-31-2014
    Location
    TN
    MS-Off Ver
    2010
    Posts
    15

    Outlook VBA Wildcard

    I currently have (Opened At 2:46) in my subject from a macro I created, with 2:46 being updated every time I use my macro with the current time. What I would like to happen, is when I receive an email back from the recipients, when I click reply all it searches for "(Opened At" in the subject and replaces with "(Closed At 2:50" with 2:50 being the current time. So I need to figure out how to use * as a wild card or just if it finds "(Opened At" then just erase the subject and put (Closed At Current Time)

    Please Login or Register  to view this content.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Outlook VBA Wildcard

    Please Login or Register  to view this content.
    This may also work (haven't tried)

    Please Login or Register  to view this content.
    Both depend on the fact that Opened and Closed have the same number of letters.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    10-31-2014
    Location
    TN
    MS-Off Ver
    2010
    Posts
    15

    Re: Outlook VBA Wildcard

    Neither worked, but could it be because it's searching every reply all? Opened and Closed isn't in every email.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Outlook VBA Wildcard

    I can't see that your question has anything to do with Outlook:

    Please Login or Register  to view this content.
    Last edited by shg; 11-22-2014 at 02:33 PM. Reason: two typos ...

  5. #5
    Registered User
    Join Date
    10-31-2014
    Location
    TN
    MS-Off Ver
    2010
    Posts
    15

    Re: Outlook VBA Wildcard

    Quote Originally Posted by shg View Post
    I can't see that your question has anything to do with Outlook:
    I don't understand how you don't see the question for outlook? The VBA code runs on Outlook starting, then when I click reply all I need it to search the subject and if it finds a match, replace it with (Closed At Current Time Frame). I am assuming your code is an example, so I tried to incorporate into my code, but I get error Object missing. Any ideas?

    Please Login or Register  to view this content.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Outlook VBA Wildcard

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-31-2014
    Location
    TN
    MS-Off Ver
    2010
    Posts
    15

    Re: Outlook VBA Wildcard

    Run-time error 424
    Set oResponse = oItem.ReplyAll

    Not sure why it is erroring out there now?

    Please Login or Register  to view this content.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Outlook VBA Wildcard

    For that, I have no idea. I don't automate Outlook.

    Where is oItem declared and initialized?
    Last edited by shg; 11-22-2014 at 03:17 PM.

  9. #9
    Registered User
    Join Date
    10-31-2014
    Location
    TN
    MS-Off Ver
    2010
    Posts
    15

    Re: Outlook VBA Wildcard

    Quote Originally Posted by shg View Post
    For that, I have no idea. I don't automate Outlook.

    Where is oItem declared and initialized?
    Sorry I rewrote the Sub to fix that, and now everything is working but I can't get it to change the subject.

    I thought it may have been formatting of closed:
    "(Closed at " & Format(Time, "hh:mm AMPM)")

    So I changed it to:
    "(Closed at " & Format(Time, "hh:mm AMPM") & ")"

    However I still have this issue:
    Please Login or Register  to view this content.
    Edit:
    Also I tried changing the period in Opened at ##.## [AP]M) to : since that is what time uses. No success, even added a MsgBox after the code to see if maybe it was changing it but not saving to the opening of the email. Still displayed the same information.
    Please Login or Register  to view this content.
    Last edited by IFeelYourPain; 11-22-2014 at 06:15 PM.

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Outlook VBA Wildcard

    There were two typos in post#4 that I fixed several hours ago.

  11. #11
    Registered User
    Join Date
    10-31-2014
    Location
    TN
    MS-Off Ver
    2010
    Posts
    15

    Re: Outlook VBA Wildcard

    I ended up getting it working when I just decided to do a manual search and replace with it, but the problem is, it saves to the subject, but doesn't display it in the Reply All Subject line. I have to close out of the Reply All popup and reopen it?

    Please Login or Register  to view this content.

+ 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. Find Wildcard, return that Wildcard value?
    By help_me_im_lost in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-08-2014, 01:20 PM
  2. Outlook 2007, Referencing mail Item created from outlook template
    By thusidie in forum Outlook Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2014, 04:33 PM
  3. [SOLVED] Using Exell VBA to launch Outlook Email while separating lines in the body of Outlook.
    By Tazyote in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-27-2013, 01:18 PM
  4. [SOLVED] Find: Using wildcard, but don't replace with wildcard
    By JimDandy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-06-2013, 05:39 PM
  5. [SOLVED] VBA Macro to print to Pdf format and place as attachment in Outlook (Excel & Outlook 2007)
    By Webman1012 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-29-2013, 01:25 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