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

1) I'm not concerned about debug.printing integers but showing the value of
the string expression that you're building from an integer and several
strings. You can step through your code with F8 after it hits the breakpoint
if you want to see how it's executing.

2) As far as I can tell, Expsrv.dll runs the Expression Service. Only the
copy in System32 matters. What operating system are you using?

Can you type this in the Immediate window, press Enter and get a result? --

? AddQuote("this text")
--
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
...
2 questions

1) Debug.Print should be able to print integers so I do not see the reason

behind changing i to a String.
Even if I input the Debug.Print line in the code, will it show up by me

just replying to a message. I do not know how to just run the sub routine
AddRecipToContacts() In the Visual Basic Editor and have it show me the
values for different variables.

2) What will changing the name Expsrv.dll on my hard drive do? How does

Jet4.0 come in to play? Is the Contacts Folder using Jet 4.0 as its databse
engine?
BTW, Expsrv.dll shows up in 3 different places on my hard drive. Do I

have to change the name in all 3 places.
c:\winnt\$NTUninstallKB837001$
C:\winnt\ServicePackFiles\i386
c:\winnt\system32

----- Sue Mosher [MVP-Outlook] wrote: -----

When in doubt about a property or method, check the object browser:

Press
ALt+F11 to open the VBA environment in Outlook, then press F2. Switch

from
All Libraries to Outlook to browse all Outlook objects and their
properties, methods, and events. Select any object or member, then

press F1
to see its Help topic.

If i is declared as an Integer, try converting it to a string:

strFind = "[Email" & Format(i) & "Address] = " & _
AddQuote(strAddress)
Debug.Print strFind

Something else to try: Locate the file Expsrv.dll on your hard

drive.
Rename it, then try Detect and Repair again. The instructions in the

KB
article at

http://support.microsoft.com/default...b;en-us;239114
might also be helpful.

--
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
news
I get the same error message
The Run-time errors bunbers are differenct but the message is

still the
same. The message states
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.
I was trying to put " Debug.Print i & strFind" right after

strFind = "[Email" & i & "Address] = " & _
AddQuote(strAddress)
but I got no output.
Ideally I would like to have used MsgBox strFind. But I do not

know if
this will work.
I tried to comment as many lines out and try to further narrow

down the
line of code that spits ou the error. It seems to be the line of

code that
is causing the error is :
Set objContact = colContacts.Find(strFind) .
I have no idea what this line of code means nor can I pull it up

on Google
Search. The only search items I get on colContacts.Find() are all

code
written by you.
Would be nice to be able to find out what the value of strFind is

after
each iteration. Should be coming up blank.
Any adivce????
----- Sue Mosher [MVP-Outlook] wrote: -----
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 it's in

another
module.
"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.