Solved

Outlook Blank Subject Field

Posted on 2004-09-20
6
592 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Create high volume marketing opportunities using email signatures with these top 10 DOs and DON'Ts of email signature marketing.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
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…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now