Macros
Greetings
So I am creating a new email message and I want to append a certain string to the subject (eg. date in ddmmyyyyhhmm format). How can that be done?
I'm trying that in VB (unless there is another way), but I couldn't find a method to get a reference of the current new email message. This will allow me to run the macro which results in appending the required string.
Any help is appreciated.
e.g.
'this is just bad...
Sub DateTag()
'Dim MyMail As mailItem
Dim strID As String
Dim mailNS As Outlook.NameSpace
Dim mailItem As Outlook.mailItem
'strID = MyMail.EntryID
Set mailNS = Application.GetNamespace("MAPI")
Set mailItem = mailNS.GetItemFromID(strID)
mailItem.Subject = "date"
mailItem.Save
Set mailItem = Nothing
Set mailNS = Nothing
End Sub
|