您的位置:首页 > 大数据 > 人工智能

如何防止MS Outlook 发送空白主题/主体的邮件?- Avoiding sending empty subject emails in Outlook

2009-12-16 15:21 1351 查看
Hi,

Sometimes we forget to put the [b]SUBJECT[/b] in the mails which we send. That could be deadly sometimes when you are communicating to the clients; to avoid such a situation, follow the steps below. There after when you send a mail without subject, a pop up window asks for your confirmation. You can try it !


[b]Steps:
[/b]
1.Open your outlook
2.Press Alt+F11. This opens the Visual Basic editor
3.On the Left Pane, one can see "[b] Microsoft Outlook[/b] [b]Objects[/b]", expand this. Now one can see the "[b]ThisOutLookSession[/b]".
4.Click on "[b]ThisOutLookSession[/b]".
5.Copy and Paste the following code in the right pane. ([b]Code[/b] [b]Pane[/b])

Code:

[b]Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)[/b] 
[b]  Dim strSubject As String[/b] 
[b]  strSubject = Item.Subject[/b] 
[b]  If Len(strSubject) = 0 Then[/b] 
[b]      Prompt$ = "Subject is Empty. Are you sure you want to send the Mail?"[/b] 
[b]      If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check for Subject") = vbNo  [/b][b]Then[/b] 
[b]              Cancel = True[/b] 
[b]      End If[/b] 
[b]  End If[/b] 
[b]End Sub[/b]


6.Save this and Now close the VB Code editor.
7.In Outlook Go to [b]Tools[/b] > [b]Macros[/b] > [b]Security[/b] > In the [b]Security Level [/b]Tab > Select the option [b]MEDIUM[/b] > OK
8.Now Restart the Outlook, a dialog box pops up to [b]Disable / Enable the macros[/b]; select as [b]Enable[/b] [b]Macros (this option will pops up when ever you restart outlook.[/b]
9.From now on , this macro will make sure you do not make the mistake of sending a mail without subject

That's it!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: