How to send private messages with this script ON??

M

moony marouane

Hi All,

----------------------------
Here is my config :
Messaging server : W2k Server / Exchange 2k
Users computers : W2k Pro / Ms Outlook 2000
----------------------------

I'm using this script (in outlook of all my users) to send a copy of each
outgoing message to : (e-mail address removed)
----------------------------
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim ObjItem As MailItem
Dim ObjNs As NameSpace
Dim ObjElementsenvoyes As MAPIFolder
Dim ObjRecip As Recipient
Set ObjNs = Application.GetNamespace("MAPI")
Set ObjElementsenvoyes = ObjNs.GetDefaultFolder(olFolderSentMail)
Set ObjRecip = Item.Recipients.Add("(e-mail address removed)")
ObjRecip.Type = olBCC
ObjRecip.Resolve
End Sub
----------------------------

And I add this mailbox ([email protected]) to outlook (for all
users) so that they can all see it, but sometimes some users need to send
private messages that the others doesn't have to see.

What should I add to this script?
Any suggestions?

Thanks in advance.
 
M

moony marouane

I got this reply in another forum:

*********************************************
If you looked in the object browser, you'd see that the MailItem object has
a Subject field. The function to search inside one string for another is
Instr(). Put them together and you get:
If Instr(Item.Subject, "Private") > 0 Then
' put your code to add the Bcc recipient here
End If
*********************************************

And that's exactly what I was looking for.
Many thanks
Moony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top