Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / January 2006

Tip: Looking for answers? Try searching our database.

How to send private messages with this script ON??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
moony marouane - 25 Jan 2006 15:49 GMT
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 : deptname.out@companyname.com
----------------------------
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("deptname.out@companyname.com")
ObjRecip.Type = olBCC
ObjRecip.Resolve
End Sub
----------------------------

And I add this mailbox (deptname.out@companyname.com) 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.
moony marouane - 30 Jan 2006 10:28 GMT
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

> Hi All,
>
[quoted text clipped - 28 lines]
>
> Thanks in advance.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.