Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 02-04-2013, 12:44 AM
macropod's Avatar
macropod macropod is offline Need help on Outlook 2010 Macro Windows 7 64bit Need help on Outlook 2010 Macro Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,513
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You probably wouldn't want to do this to every email, but only to selected emails.

As I said in my previous post, I don't use Outlook (and don't really have time to learn it's intricacies), so the following is based on code from: http://www.vboffice.net/sample.html?...9&cmd=showitem
Code:
Public Sub ReplyMail()
  Dim obj As Object
  Dim oReply As Outlook.MailItem
  Select Case True
    Case TypeOf Application.ActiveWindow Is Outlook.Inspector
      Set obj = Application.ActiveInspector.CurrentItem
    Case Else
      With Application.ActiveExplorer.Selection
        If .Count Then Set obj = .Item(1)
      End With
      If obj Is Nothing Then Exit Sub
  End Select
  If TypeOf obj Is Outlook.MailItem Then
    Set oReply = obj.Reply
    With oReply
      If Not .Subject Like "*CASE##???###########" Then
        .Subject = .Subject & " - CASE" & Format(Now, "DDMMMYYhhmmss") & Format((Len(.Subject) Mod 1000), "000")
      End If
      .Display
    End With
  End If
End Sub
If you assign the above to a keyboard shortcut, I believe it will initialize a reply with the required additional header text, where appropriate, whenever an email is selected and the keyboard shortcut is invoked.

If you're interested in Outlook programming, see: http://msdn.microsoft.com/en-us/libr...gInOutlook2010. In addition to it's own examples, that page has a number of useful links, one of which took me to the link mentioned earlier in this post.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro help outlook 2010 seanchad Outlook 0 06-28-2012 02:49 AM
Need help on Outlook 2010 Macro Word 2010 Macro jomarie Office 1 02-19-2012 07:45 PM
Mail with macro Excel 2010 santors71 Excel Programming 1 12-07-2011 06:34 AM
Macro - Microsoft Word 2010 OfficeHelpSG Word 3 10-18-2011 11:54 AM
Need help on Outlook 2010 Macro Run a Macro in Word 2010 Joyce301 Word VBA 3 04-29-2011 03:27 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:53 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft