Solved

Outlook Blank Subject Field

Posted on 2004-09-20
6
594 Views
Last Modified: 2012-06-27
I need to retrict Outlook from allowing a blank subject to be sent and have located a similar issue answered in Experts Exchange, confirming inserting the following code after pressing ALT & F11. However ALT & F11 opens a blank Visual Basic screen and I am not sure how to complete the process from here. Alternatively is there a simpler way of achieving the same result?

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    If Len(Item.Subject & vbNullString) = 0 Then
        MsgBox "Please enter a Subject"
        Cancel = True
    End If
End Sub

0
Comment
Question by:itcroydon
  • 4
  • 2
6 Comments
 
LVL 33

Expert Comment

by:sajuks
ID: 12100628
Open VBA editor (AltF11)
expand Project1
expand Microsoft Outlook Objects
Expand thisOutlookSession

//Paste the code
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
   If Item.Subject = "" Then
       MsgBox "You forgot the subject."
       Cancel = True
   End If
End Sub

When you close Outlook accept to save the Outlook Project or press Ctrl+S and the restart Outlook.

To run the script you may need to set the macro security lower.
0
 
LVL 1

Author Comment

by:itcroydon
ID: 12100674
How do i expand project one? Project 1 shows on the title bar of the Visual Basic screen but apart from that, the menu bar and the toolbar I have a completely black screen.
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12100688
Thats cos you dont have any other macros in it.
You should be something like
Project 1 ()
 - Microsoft office olook Obj
  -- ThisOutlooksession

on the left pane and nothing in the right pane.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 33

Expert Comment

by:sajuks
ID: 12100691
Copy and paste the code in the right pane after selecting the ThisOutlooksession
0
 
LVL 1

Author Comment

by:itcroydon
ID: 12100833
Sorry, I have never used Visual Basic before so please bear with me.

There is nothing on the screen below the toolbar, no panes at all just a completely black screen. i.e.

Title bar shows - Microsoft Visual Basic Project 1
Menu Bar shows - File, Edit etc.
Toolbar - view Outlook, show user form, save buttons etc.
Below the toolbar the rest of the screen is completely black

For reference I am using Outlook 2002, Windows XP Pro & Visual Basic 6.3.
0
 
LVL 33

Accepted Solution

by:
sajuks earned 500 total points
ID: 12100886
Press Ctrl+R or go to
View > Project Explorer
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Read this checklist to learn more about the 15 things you should never include in an email signature.
In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question