I followed the instruction and ran Hel | Detect and Repair? The system said it ran it successfully
I added your simple test macro to ThisOutlookSession module and ran it with F5 and it ran successfully
I inserted a breakpoint in the Application_ItemSend at the following line (If Item.Class = olMail Then) and when I tried replying to a message it broke at that line. So the Application_ItemSend eventHandler is firing properly. It would have to fire properly because it was making a method call to AddRecipToContacts.
It is in AddRecipToContacts method that I am getting my error. When the program gets to the routine to check and see if the recipient is already in Contacts it goes through the following code
strAddress = objSRecip.Addres
For i = 1 To
strFind = "[Email" & i & "Address] = " &
AddQuote(strAddress
Set objContact = colContacts.Find(strFind
At the "Set objContact = colContacts.Find(strFind)" is where the routing gets hung up and displays the runtime error.
So i did a little debuggin for you. I write a little advanced java code so I can follow most codes. I commented out the whole subroutine (check to see if the recipient is already in Contacts). So I commented out the following lines.
' For i = 1 To
' strFind = "[Email" & i & "Address] = " &
' AddQuote(strAddress
' Set objContact = colContacts.Find(strFind
' If Not objContact Is Nothing The
' Exit Fo
' End I
' Nex
' if not, add i
' If objContact Is Nothing The
This way the program would just add users I reply to not checking to see if they exist in the Contacts Folder. This worked successully. It added the user's name and e-mail address I replied to.
Can you help me debug the part of your code I commented out. Is this line of code proper
strFind = "[Email" & i & "Address] = " &
' AddQuote(strAddress
Also, can the AddQuote method belong in the same module or does it have to be in a separate module.
Thanks for all your hlep
----- Sue Mosher [MVP-Outlook] wrote: ----
Did you follow the message's instructions and run Help | Detect and Repair
YOu can use this as a simple test macro and run it with F5 from the VB
window
Sub HelloWorl
MsgBox "Hello World!
End Su
To set a breakpoint, position your cursor on the line where you want cod
execution to stop, then press F
Since you're new to Outlook VBA macros, these web pages should help you ge
started
http://www.winnetmag.com/Articles/Index.cfm?ArticleID=21522&pg=
http://www.outlookcode.com/d/vb.ht
--
Sue Mosher, Outlook MV
Author o
Microsoft Outlook Programming - Jumpstart fo
Administrators, Power Users, and Developer
http://www.outlookcode.com/jumpstart.asp
Roy said:
I set the Security to Low and I restarted Outlook
Failed to start the Expression Service. The Expression Service might no
be installed. This problem may be resolved by using Detect and Repair o
the Help menu or re-running Office XP setupand highlights the following line with an arrow in the side bar
Set objContact = colContacts.Find(strFind
how? Also, how do I set a breakpoint in the Application_ItemSend event
handler to see if it's firing.
Thank you so much for all your help.
----- Sue Mosher [MVP-Outlook] wrote: -----
You must set Tools | Macro | Security to Low or Medium or leave it
set to
High and use the Selfcert.exe tool that comes with Office to sign the
project. Restart Outlook after changing the security level.
The Application_ItemSend event handler must be in the
ThisOutlookSession
module.
For troubleshooting, see if you can run any simple Outlook macro, and
set a
breakpoint in the Application_ItemSend event handler to see if it's firing.
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
the
ThisOutlookSession module under Project1. remainder of
the code in each of those modules. checked the
SafeOutlookLibrary under Tools/References in Microsoft Visual Basic. returned to
Outlook from the File Menu. message.
But the recepient's e-mail address was not added to my Contact List. you
detail for me the steps you took to install this code. your help
thus far.
----- Russ Valentine [MVP-Outlook] wrote: -----
No.
You can use code to do that if you want:
http://www.outlookcode.com/d/code/autoaddrecip.htm
--
Russ Valentine
[MVP-Outlook]
Roy said:
The question is, when I reply to an e-mail message shouldn't the
recepient's e-mail address be added to my contacts folder.
If the answere is yes, my e-mail program is not doing that. How
can I get
my e-mail program to do that?