Thread: Address Book
View Single Post
  #15  
Old June 3rd, 2004, 12:27 AM
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: n/a
Default Address Book

What is the value of strFind when you get the error? Are you getting the
same error message you reported earlier or something different?

AddQuote() can be anywhere but needs to be Public if its in another module.

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


"Roy" wrote in message
...
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.Address
For i = 1 To 3
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 3
' strFind = "[Email" & i & "Address] = " & _
' AddQuote(strAddress)
' Set objContact = colContacts.Find(strFind)
' If Not objContact Is Nothing Then
' Exit For
' End If
' Next

' if not, add it
' If objContact Is Nothing Then

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.



"Roy" wrote in message
...
I set the Security to Low and I restarted Outlook.
When I went to reply to a message I got the following error.
Run-time error '-1214234619(b7a04005)':

Failed to start the Expression Service. The Expression Service

might not
be installed. This problem may be resolved by using Detect and

Repair on
the Help menu or re-running Office XP setup.
The error message has a few button on the bottom "End" "Debug"

"Help"
When I click on Debug, it directs me to the Modules Folder under

Project1
and highlights the following line with an arrow in the side bar.
Set objContact = colContacts.Find(strFind)
I do not know what this means or how to fix it. Can you please

advise?
Also, The Application_ItemSend event handler is in the

ThisOutlookSession
module.
I do not know how to run a simple Outlook Macro. Can you please

tell me
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.