oliv-
Senior Member
- Outlook version
- Outlook 2010 32 bit
- Email Account
- Exchange Server
Hi,
I need your opinion on my current project.
I have a a shared mailbox, and 2 or more users. Each user has the program.
When a new Email is added in the Inbox Folder of this shared mailbox, i want to Print it just once.
No problem for printing it.
s my test for whether only the first that starts the treatment is good ?
I need your opinion on my current project.
I have a a shared mailbox, and 2 or more users. Each user has the program.
When a new Email is added in the Inbox Folder of this shared mailbox, i want to Print it just once.
No problem for printing it.
s my test for whether only the first that starts the treatment is good ?
Code:
Dim WithEvents colInboxPartageeItems As Items
Private Sub Application_Startup()
Dim NS As Outlook.NameSpace
Set NS = Application.GetNamespace("MAPI")
Set colInboxPartageeItems = NS.Stores("Sin-constr.gsn").GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub colInboxPartageeItems_ItemAdd(ByVal Item As Object)
If InStr(1, Item.Subject, "Test", vbTextCompare) Then
If Item.FlagIcon = 0 Then
Item.FlagIcon = olGreenFlagIcon
On Error Resume Next
' : Number : -2147221239 : Long : ThisOutlookSession.colInboxPartageeItems_ItemAdd
Item.Save
If Err.Number = -2147221239 Then
Exit Sub
Else
Call go_Process_item(Item)
End If
End If
End If
End Sub
Sub go_Process_item(Item)
msgbox_uf.Show vbModeless
msgbox_uf.TextBox1.MultiLine = True
msgbox_uf.TextBox1 = Item & vbTab & Date & vbTab & Time & vbCrLf & msgbox_uf.TextBox1
End Sub