vba - Running a script in shared mailbox only when opening a mail -


i have tried find answer question on web. since don't have experience outlook-vba decided ask here.

what i'm trying run script when user opens mail. need run script in shared mailboxes not in users own box.

i've used code found in users @zza question # 21727768 has little annoyance creating mail , replying 1 (it runs script in these cases also). helpful haven't found way apply code cases user opening mail shared mailbox.

any here?

thanks!

okay, found easier way (this code question linked to, in op)

public withevents myitem outlook.mailitem public eventsdisable boolean    private sub application_itemload(byval item object)     if eventsdisable = true exit sub     if item.class = olmail         set myitem = item     end if end sub   private sub myitem_open(cancel boolean)     eventsdisable = true     'this new part     if myitem.parent = "nameofyoursharedinbox"         'your code here     end if     eventsdisable = false end sub 

mostly credits hstay

hth


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -