You must create a VBA procedure (not, technically, a script) first, using this syntax:
Sub MyProcedure(myMailItem as Outlook.MailItem)
' your code to work with myMailItem goes here
' for example:
MsgBox myMailItem.Subject
End Sub

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> Hello everyone,
>
[quoted text clipped - 9 lines]
>
> Thanks
XxLicherxX - 29 Jun 2005 21:58 GMT
Hi Sue,
Thanks for the response. Where do I write this procedure?
Thanks
Sue Mosher [MVP-Outlook] - 29 Jun 2005 22:28 GMT
In the Outlook VBA environment, either in the built-in ThisOutlookSession module or any regular module you want to add to the VBA project.

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> Hi Sue,
>
> Thanks for the response. Where do I write this procedure?
>
> Thanks
XxLicherxX - 05 Jul 2005 21:24 GMT
Hi Sue,
I have written a simple script using Outlook's VBA editor. How do I get
this to show up in the "run a script" part of the "create a rule"
wizard?
Thanks
Sue Mosher [MVP-Outlook] - 05 Jul 2005 21:48 GMT
A VBA procedure for use with a "run a script" rule needs to be a Public Sub with a MailItem as an argument:
Public Sub MyMacro(msg as MailItem)
Dim strID as String
Dim olNS as Namespace
Dim olMail as MailItem
strID = msg.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set olMail = olNS.GetItemFromID(strID)
' do stuff with olMail
Set olMail = Nothing
Set olNS = Nothing
End Sub

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> Hi Sue,
>
[quoted text clipped - 3 lines]
>
> Thanks
XxLicherxX - 06 Jul 2005 14:37 GMT
Thanks,
This is doing exactly what I want.