|
-
Jan 19th, 2007, 09:29 AM
#1
Thread Starter
Hyperactive Member
Send a mail with to,cc,bcc fields blank
HI all
I m creating a Addin( Outlook) for people who often forget to fill To,bcc,cc of a new mail. I want to add a default email Id in the "to" fileld of a mail if user forget to fill to,cc,bcc. I have done it using myOlInspectors_NewInspector event. I have add "to" field in my mailItem so that user don't get the message
" There must be atleast one name in to,cc,bcc or distribution list".
But problem is that whenver new mail window opens the given Email ID is shown in TO field ( naturally I don't want that) . This is in case of office 2003, in office xp it doesn't show.
Is there any method so I can add a default EmailID if user forget entering all fields.
I have given my code here.
Please help..
Private Sub myOlInspectors_NewInspector(ByVal Inspector As Outlook.Inspector)
On Error Resume Next
Set myinsp = Inspector
If myinsp.CurrentItem.Class = olMail Then
myinsp.CommandBars.Item("Standard").Visible = True
Set newMail = myinsp.CurrentItem
newMail.To = "[email protected]" ' I THINK ITS NOT A GOOD IDEA
End If
End Sub
Private Sub myolApp_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim reply As Integer
Dim cancelFlag As Boolean
If cancelFlag = True Then
newMail.To = "[email protected]"
End If
If (newMail.To = "[email protected]" Or newMail.To = "") And newMail.CC = "" And newMail.BCC = "" Then
msgstring = "you have not specified any recipients for this message. Do you wan to send it on default Id?"
reply = MsgBox(msgstring, vbYesNo, "Default EmailId")
If reply = vbNo Then
Item.To = ""
Cancel = True
cancelFlag = True
'myolApp.ActiveInspector.Close (olDiscard)
End If
End If
End Sub
Using .NET 3.5 (VS 2008) And XP SP2

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|