Solved

Outlook Blank Subject Field

Posted on 2004-09-20
6
595 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Outlook 2010 error 10 25
Outlook 2012 VBA: Object missing 14 41
Troubles viewing HTML in Outlook 2010 client 3 28
From msAccess find correct email account in outlook 6 26
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
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…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

809 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