vba - How to implement automatic date in the subject for particular sender in the Outlook? -


i need automation feasibility data changing in subject , body of message.

for example,

subject-update required 15-july-2015

body of message

xxxxxxxxxxxxx 14-july-2015

note-in subject date has today's date in body of message need previous day date.

can automation this.

you can use itemsend event of application class if need modify outcoming emails.

 public withevents myolapp outlook.application    public sub initialize_handler()     set myolapp = outlook.application    end sub    private sub myolapp_itemsend(byval item object, cancel boolean)     dim prompt string    prompt = "are sure want send " & item.subject & "?"     if msgbox(prompt, vbyesno + vbquestion, "sample") = vbno       cancel = true     end if    end sub 

in case if need modify incoming emails need handle newmailex event of application class. event fires once every received item processed microsoft outlook. item can 1 of several different item types, example, mailitem, meetingitem, or sharingitem. entryidscollection string contains entry id corresponds item. note behavior has changed earlier versions of event when entryidcollection contained list of comma-delimited entry ids of items received in inbox since last time event fired.

the newmailex event fires when new message arrives in inbox , before client rule processing occurs. can use entry id returned in entryidcollection array call namespace.getitemfromid method , process item. use method caution minimize impact on outlook performance.

finally, may find getting started vba in outlook 2010 article helpful.


Comments