A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - General Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Custom Rules



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 25th 06, 04:28 PM posted to microsoft.public.outlook
[email protected]
external usenet poster
 
Posts: 1
Default Custom Rules

I'd like to set up something to send an acknowledgment to certain
emails. The actions I want to do are not supported by the Rules
Wizard, so basically if an email has a certain string in the subject or
body I want to run some code.

In more detail the code the look for an ID withing the above string and
then use this as a value in a SQL statement on an Access database to
get the correct email to send an acknowledgement to (it has to be a
different email than what it originates from for security puroposes).

Another factor is we use Scalix as our email server.

I'm really not sure how to begin. I think I can handle the SQL and
sending mail stuff, but, I don't know how to make a rule or how Scalix
plays into things.

I'd consider an add in too that could do this.

Thanks for any help.

  #2  
Old May 25th 06, 05:19 PM posted to microsoft.public.outlook
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Custom Rules

A "run a script" rule action in Outlook 2002 or later uses a VBA procedure with a MailItem or MeetingItem as its parameter. That item is processed by the code:


Sub RunAScriptRuleRoutine(MyMail As MailItem)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim msg As Outlook.MailItem

strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set msg = olNS.GetItemFromID(strID)
' do stuff with msg, e.g.
MsgBox msg.SUbject

Set msg = Nothing
Set olNS = Nothing
End Sub

See http://www.outlookcode.com/d/code/zaphtml.htm#ol2002 for another example.

FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at http://www.microsoft.com/office/comm....program_v ba

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

wrote in message oups.com...
I'd like to set up something to send an acknowledgment to certain
emails. The actions I want to do are not supported by the Rules
Wizard, so basically if an email has a certain string in the subject or
body I want to run some code.

In more detail the code the look for an ID withing the above string and
then use this as a value in a SQL statement on an Access database to
get the correct email to send an acknowledgement to (it has to be a
different email than what it originates from for security puroposes).

Another factor is we use Scalix as our email server.

I'm really not sure how to begin. I think I can handle the SQL and
sending mail stuff, but, I don't know how to make a rule or how Scalix
plays into things.

I'd consider an add in too that could do this.

Thanks for any help.

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
rules wizard needs ability to select all rules TxFiberTrainer Outlook - Installation 0 May 23rd 06 09:55 PM
Emailing a contact vCard with custom form loses all custom info Kim Outlook - Using Contacts 7 April 27th 06 01:21 AM
MSG Custom properties on right click custom tab Steph Outlook and VBA 1 February 1st 06 06:55 PM
Cannot programmatically open custom message in custom form ms Outlook - Using Forms 1 January 20th 06 04:01 PM
custom outlook rules MILO Outlook - Installation 0 January 18th 06 05:47 PM


All times are GMT +1. The time now is 08:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.