Hi all

I wrote some macros in Outlook 2003, which I want to give to someone who runs Outlook 2000. I worked out how to do this by copying the my VBAProjectFile and the outcmd.dat file into their Outlook profile in their local documents and settings. However, Outlook 2003 uses the Outlook Reference Library 11.0, whereas Outlook 2000 uses an earlier library, e.g. version 9.0.

I didnt think this would make a difference, but it does unfortunately. Will the code I have written below work on Office 2000 (I have my suspicions with the ActiveInspector property: what do you think) ? Please can someone try this in Outlook 2000 and maybe think of any suggestions for modifying the procedures if they cannot get the correct library?

Here is the code:

[VBA]
'---Sub that calls the userform, containing a textbox called SaveDate
'---a combobox called Class, a textbox called title, a checkbox called
'---InternetTick and a textbox called FileName. Also 2 buttons called
'---okButton and CancelButton.

Public objNewMail As Outlook.MailItem

Sub SubjectName()
SubjectNameForm.Show
End Sub

Option Explicit

'---Declarations
Dim pm As String
Dim TodayDate As String
Dim internetauthorised As String
Dim replysubject As String

'---UserForm Set Up

Private Sub UserForm_Initialize()
Set objNewMail = Outlook.ActiveInspector.CurrentItem
replysubject = ""

'---Sets Date
SaveDate = Format(Date, "yyyymmdd")

'---Sets Classification menu
Class.AddItem ("U - Unrestricted")
Class.AddItem ("P - Private")

'---If Email is a Re/Fwd, ensures email does not start with RE:FW etc

If Left(objNewMail.Subject, 3) = "RE:" Or Left(objNewMail.Subject, 3) = "FW:" _
Then Title = objNewMail.Subject

End Sub

Private Sub Title_Enter()
If SubjectNameForm.Title.BackColor <> RGB(255, 255, 255) Then
SubjectNameForm.Title.BackColor = RGB(255, 255, 255)
Title = ""
End If
End Sub

Private Sub Update_Filename()

pm = Left(Class, 1)
If InternetTick.Value = True Then internetauthorised = "Internet-Authorised:" _
Else internetauthorised = ""
FileName = internetauthorised & SaveDate & " " & pm & " " & Title
End Sub

'---These sub updates the file name in the preview window as the user
'---changes the options

Private Sub Title_Change()
Call Update_Filename
End Sub

Private Sub SaveDate_Change()
Call Update_Filename
End Sub

'---Gathers all the infomation from the options and presents it to
'---the email subject line

Private Sub okButton_click()
objNewMail.Subject = FileName
Unload Me
End Sub

'---This button exits the form

Private Sub CancelButton_Click()
Unload Me
End Sub

[/VBA]