Address Book

R

Roy

I am using Windows 2000 Professional

When I reply to a message the computer saves the e-mail address for me so that when I go to send a new message and I begin to type in the e-mail address, the system auto-completes the rest of the e-mail address for me. This is great

However, when I double click on the the TO: I do not find that individual's e-mail address in the list of names. When I click on Address Book, I have 3 options. Outlook Address Book (which is empty) a subfolder under the Outlook Address Book called Contacts (this has all my old e-mail addresses) and Personal Address Book (which is also empty)

How can I find out where the system is storing the information. And how can I get the system to write the e-mail address of the recepient I reply to to my Contacts folder or my Outlook Address Book or my Personal Address Book

Thanks.
 
R

Russ Valentine [MVP-Outlook]

Your Outlook version would be of relevance here.
Not your operating system.

--
Russ Valentine
[MVP-Outlook]
Roy said:
I am using Windows 2000 Professional.

When I reply to a message the computer saves the e-mail address for me so
that when I go to send a new message and I begin to type in the e-mail
address, the system auto-completes the rest of the e-mail address for me.
This is great.
However, when I double click on the the TO: I do not find that
individual's e-mail address in the list of names. When I click on Address
Book, I have 3 options. Outlook Address Book (which is empty) a subfolder
under the Outlook Address Book called Contacts (this has all my old e-mail
addresses) and Personal Address Book (which is also empty).
How can I find out where the system is storing the information. And how
can I get the system to write the e-mail address of the recepient I reply to
to my Contacts folder or my Outlook Address Book or my Personal Address
Book.
 
R

Roy

I was able to find the file that the system saves all my e-mail addresses to. The system saves it to a file called Outlook.NK2.

The question is how do I direct my Address Book to look at that file.

The Persoanl Address Book only looks for file that have the extension (*.PAB).

The Outlook Address Book gives me the following error when I click on Properties. The Properties dialog box could not be displayed. An attempt was made to opne an unsupported property.
 
R

Russ Valentine [MVP-Outlook]

Outlook has not used a PAB file for over 5 years. Are you, and if so, why?
You should be using the Outlook Address Book and your Contacts Folder.

The Autocompletion cache is completely independent from your Contacts
Folder. You cannot direct it to your Contacts Folder.

--
Russ Valentine
[MVP-Outlook]
Roy said:
I was able to find the file that the system saves all my e-mail addresses
to. The system saves it to a file called Outlook.NK2.
The question is how do I direct my Address Book to look at that file.

The Persoanl Address Book only looks for file that have the extension (*.PAB).

The Outlook Address Book gives me the following error when I click on
Properties. The Properties dialog box could not be displayed. An attempt
was made to opne an unsupported property.
 
R

Russ Valentine [MVP-Outlook]

Then why did you say you were using a PAB?
I already told you that you can't make this happen. Autocompletion uses a
cache derived from messages you have already sent, not your Contacts Folder.
--
Russ Valentine
[MVP-Outlook]
Roy said:
I am not using PAB. I'm using Outlook Address Book and my Contacts Folder.

The only problem is when I reply to someone, shouldn't his e-mail address
be added to my contacts folder automatically. This is not happening. Can
you please tell me how can I make this happen.
 
R

Roy

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?
 
S

Sue Mosher [MVP-Outlook]

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



Roy said:
So, I went to the URL.

I copied the Private Sub Application_ItemSend code to the
ThisOutlookSession module under Project1.
I inserted a new Module and a new Class Module and copied the remainder of
the code in each of those modules.
I downloaded the Redemption file and executed that file. I checked the
SafeOutlookLibrary under Tools/References in Microsoft Visual Basic.
I then Compiled Project1 from the DeBug menu and closed and returned to Outlook from the File Menu.

After doing all of this, I replied to a message and sent a new message.
But the recepient's e-mail address was not added to my Contact List.
Did I miss a step? Has anyone used this code successfully and can you
detail for me the steps you took to install this code.
If I need to add a name uner Tools Macro what name should I add.

Any help would be greatly appreciated and thank you Russ for all 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. can I get
my e-mail program to do that?
 
S

Sue Mosher [MVP-Outlook]

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 VBA
window:

Sub HelloWorld
MsgBox "Hello World!"
End Sub

To set a breakpoint, position your cursor on the line where you want code
execution to stop, then press F9

Since you're new to Outlook VBA macros, these web pages should help you get
started:

http://www.winnetmag.com/Articles/Index.cfm?ArticleID=21522&pg=1
http://www.outlookcode.com/d/vb.htm


--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Roy said:
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.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Roy said:
So, I went to the URL.
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?
 
R

Roy

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
So, I went to the URL.
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?
 
S

Sue Mosher [MVP-Outlook]

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



Roy said:
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 said:
I set the Security to Low and I restarted Outlook.
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. Project1
and highlights the following line with an arrow in the side bar.
Set objContact = colContacts.Find(strFind)
ThisOutlookSession
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. ThisOutlookSession
macro, and
set a
breakpoint in the Application_ItemSend event handler to see if
it's
firing.
 
R

Roy

I get the same error message

The Run-time errors bunbers are differenct but the message is still the same. The message state
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 th
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 MV
Author o
Microsoft Outlook Programming - Jumpstart fo
Administrators, Power Users, and Developer
http://www.outlookcode.com/jumpstart.asp


Roy said:
I followed the instruction and ran Hel | Detect and Repair? The syste said it ran it successfully
(If Item.Class = olMail Then) and when I tried replying to a message i
broke at that line. So the Application_ItemSend eventHandler is firin
properly. It would have to fire properly because it was making a metho
call to AddRecipToContactsprogram gets to the routine to check and see if the recipient is already i
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 th routing gets hung up and displays the runtime error
So i did a little debuggin for you. I write a little advanced java cod
so I can follow most codes. I commented out the whole subroutine (chec
to see if the recipient is already in Contacts). So I commented out th
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 se
if they exist in the Contacts Folder. This worked successully. It adde
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 lin
of code proper
strFind = "[Email" & i & "Address] = " &
' AddQuote(strAddress
be in a separate module.
Thanks for all your hlep. I set the Security to Low and I restarted Outlook.
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. Project1
and highlights the following line with an arrow in the side bar.
Set objContact = colContacts.Find(strFind)
ThisOutlookSession
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. ThisOutlookSession
macro, and
set a
breakpoint in the Application_ItemSend event handler to see if
it's
firing.
 
S

Sue Mosher [MVP-Outlook]

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.aspx?scid=kb;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 said:
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 said:
I followed the instruction and ran Hel | Detect and Repair? The
system
said it ran it successfully. ran it
with F5 and it ran successfully. 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. 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. 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. 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.
might not
be installed. This problem may be resolved by using Detect
and
Repair on
the Help menu or re-running Office XP setup. Project1
and highlights the following line with an arrow in the side bar. ThisOutlookSession 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.
 
R

Roy

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\i38
c:\winnt\system3

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

When in doubt about a property or method, check the object browser: Pres
ALt+F11 to open the VBA environment in Outlook, then press F2. Switch fro
<All Libraries> to Outlook to browse all Outlook objects and thei
properties, methods, and events. Select any object or member, then press F
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 strFin

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 K
article at http://support.microsoft.com/default.aspx?scid=kb;en-us;23911
might also be helpful

--
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 get the same error messag same. The message state
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 setup
I was trying to put " Debug.Print i & strFind" right afte
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 i this will work
I tried to comment as many lines out and try to further narrow down th
line of code that spits ou the error. It seems to be the line of code tha
is causing the error is
Set objContact = colContacts.Find(strFind)
Search. The only search items I get on colContacts.Find() are all cod
written by you
Would be nice to be able to find out what the value of strFind is afte 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 gettin
th
same error message you reported earlier or something different
AddQuote() can be anywhere but needs to be Public if it's in anothe module I followed the instruction and ran Hel | Detect and Repair? Th
syste
said it ran it successfully ran i
with F5 and it ran successfully following lin
(If Item.Class = olMail Then) and when I tried replying to a messag i
broke at that line. So the Application_ItemSend eventHandler i firing
properly. It would have to fire properly because it was making a method
call to AddRecipToContacts. 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. 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. 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.
might not
be installed. This problem may be resolved by using Detect
and
Repair on
the Help menu or re-running Office XP setup. Project1
and highlights the following line with an arrow in the side bar. ThisOutlookSession 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.
 
S

Sue Mosher [MVP-Outlook]

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



Roy said:
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.aspx?scid=kb;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 said:
I get the same error message
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. 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) .
on Google
Search. The only search items I get on colContacts.Find() are all code
written by you. 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?
another
module. message
system
said it ran it successfully. ran it
with F5 and it ran successfully. 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. 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.
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.
 
R

Roy

I am using Window 2000 Profession as my operating system

I typed ? AddQuote("this text") in the Immediate Window and hit Enter and got "this text" back

BTW, I inserted the Debug.Print strFind, put in a breakpoint at that line and replied to a message. When it hit the breakpoint, I pressed F8 and it displayed [Email1Address] = "(e-mail address removed)" which is correct. Then I pressed F8 again and it gave me the same error Failed to Start the Expression Service.

I downloaded Jet 4.0 Sp8 for Windows 2000 and installed it on my system

When I tried to reply to a message got the same error

I renamed the expsrv.dll in c:\winnt\system32 to roy and then in Outlook ran Help | Detect & Reapir. It said Office XP Professional ran successfully. The file expsrv.dll reappeared in c:\winnt\system32

Replied to a message got the same error. Failed to start Expression Service

Any advice on what I should do next to try and resolve this problem????


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

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

2) As far as I can tell, Expsrv.dll runs the Expression Service. Only th
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 MV
Author o
Microsoft Outlook Programming - Jumpstart fo
Administrators, Power Users, and Developer
http://www.outlookcode.com/jumpstart.asp


Roy said:
2 question behind changing i to a String
Even if I input the Debug.Print line in the code, will it show up by m
just replying to a message. I do not know how to just run the sub routin
AddRecipToContacts() In the Visual Basic Editor and have it show me th
values for different variablesJet4.0 come in to play? Is the Contacts Folder using Jet 4.0 as its databs
engine
BTW, Expsrv.dll shows up in 3 different places on my hard drive. Do
have to change the name in all 3 places
c:\winnt\$NTUninstallKB837001
C:\winnt\ServicePackFiles\i38
c:\winnt\system3
----- Sue Mosher [MVP-Outlook] wrote: ----
When in doubt about a property or method, check the object browser
Pres
ALt+F11 to open the VBA environment in Outlook, then press F2. Switc fro
<All Libraries> to Outlook to browse all Outlook objects and thei
properties, methods, and events. Select any object or member, the press F
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 strFin
Something else to try: Locate the file Expsrv.dll on your har
drive
Rename it, then try Detect and Repair again. The instructions in th K
article a http://support.microsoft.com/default.aspx?scid=kb;en-us;23911
might also be helpful
Sue Mosher, Outlook MV
Author o
Microsoft Outlook Programming - Jumpstart fo
Administrators, Power Users, and Developer
http://www.outlookcode.com/jumpstart.asp
I get the same error message
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. 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) .
on Google
Search. The only search items I get on colContacts.Find() are all code
written by you. 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?
another
module. message
system
said it ran it successfully. ran it
with F5 and it ran successfully. 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. 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.
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.
 
S

Sue Mosher [MVP-Outlook]

Namespace.GetDefaultFolder() returns your default Contacts folder, i.e. the
one in the hierarchy whose top level is labeled Outlook Today, the same one
where your default Inbox resides. The Items collection is the collection of
all items in that folder.

When in doubt, 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.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Roy said:
Hello Sue,

Don't know if you are tyring to figure out the problem I am having or have simply given up on it.

In your line of code,
Set colContacts = objNS.GetDefaultFolder(olFolderContacts).Items

How can I get to see what Contact Folder the system is bringing up. I
imagine this code is bringing up all the contacts in my contact folder. IF
it is not, can you please explain what that line of code is doing.
 
R

Roy

So then, colContacts stores all of the items in my contacts folder

How can I print colContacts to the Immediate Folder. I want to see if colContacts is storing anything or if it is coming up empty because it cannot find the default Contacts folder. I especially want to see what colContacts is storing.

For example, if colContacts is empty I can then see why "Set objContact = olContacts.Find(strFind)
would be spitting out an error.

I would also like to compare colContacts information to the list I have in my Contacts folder. IF the list matches, then I have eliminated this line of code from debugging. But if the conetnts of colContacts is coming up empty, then I know I have to do further research on this line of code.

Thanks

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

Namespace.GetDefaultFolder() returns your default Contacts folder, i.e. th
one in the hierarchy whose top level is labeled Outlook Today, the same on
where your default Inbox resides. The Items collection is the collection o
all items in that folder

When in doubt, check the object browser: Press ALt+F11 to open the VB
environment in Outlook, then press F2. Switch from <All Libraries> t
Outlook to browse all Outlook objects and their properties, methods, an
events. Select any object or member, then press F1 to see its Help topic

--
Sue Mosher, Outlook MV
Author o
Microsoft Outlook Programming - Jumpstart fo
Administrators, Power Users, and Developer
http://www.outlookcode.com/jumpstart.asp


Roy said:
Hello Sue
Set colContacts = objNS.GetDefaultFolder(olFolderContacts).Item
imagine this code is bringing up all the contacts in my contact folder. I
it is not, can you please explain what that line of code is doing
 
S

Sue Mosher [MVP-Outlook]

Repeating: When in doubt, 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 you looked up the Items collection in the object browser, you'd see that
it has a Count property that you can use to determine whether there are any
items in the folder.

You can iterate any Items collection with a For Each ... Next loop:

Set colContacts = objNS.GetDefaultFolder(olFolderContacts).Items
If colContacts.Count > 0 Then
For Each objItem in colContacts
Debug.Print objItem.Subject
Next
Else
Debug.Print "No contacts in default folder"
End If


--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Roy said:
So then, colContacts stores all of the items in my contacts folder.

How can I print colContacts to the Immediate Folder. I want to see if
colContacts is storing anything or if it is coming up empty because it
cannot find the default Contacts folder. I especially want to see what
colContacts is storing.
For example, if colContacts is empty I can then see why "Set objContact = olContacts.Find(strFind)"
would be spitting out an error.

I would also like to compare colContacts information to the list I have in
my Contacts folder. IF the list matches, then I have eliminated this line
of code from debugging. But if the conetnts of colContacts is coming up
empty, then I know I have to do further research on this line of code.
Thanks.

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

Namespace.GetDefaultFolder() returns your default Contacts folder, i.e. the
one in the hierarchy whose top level is labeled Outlook Today, the same one
where your default Inbox resides. The Items collection is the collection of
all items in that folder.

When in doubt, 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.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Roy said:
Hello Sue,
or have
simply given up on it.
Set colContacts = objNS.GetDefaultFolder(olFolderContacts).Items
up. I
imagine this code is bringing up all the contacts in my contact folder. IF
it is not, can you please explain what that line of code is doing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top