Populating CC field from dropdown box. Operation failed error on s

G

Guest

In a custom Outlook message form, I am populating the CC field with a name
selected from a dropdown list by checking the "Set the initial value of this
field to:" checkbox on the Value properties tab of the CC field and inserting
the dropdown list name [Sponsor]. I have selected the radio button "Calculate
this formula automatically".

This works correctly. The selected name is inserted in the CC field once the
selection is made in the dropdown list. However, when the Send button is
clicked, I get an "Operation has failed" message. I have tried several
different ways of listing the names in the dropdown list, even using the SMTP
email address, but nothing works.

Can anyone help me with this problem?

Thanks in advance,
 
S

Sue Mosher [MVP-Outlook]

Are you resolving the recipients with Check Names before you send?

What version of Outlook? Is this a form for internal use only?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

I would very much appreciate any code necessary for resolving the recipients
as you mention below. I have been looking through the books I have, and
figured that is probably what I need, but have not been able to work it out
for myself. I don't have any kind of programming background, so I pretty much
stumble through that.

We are on Outlook 2003. This will be an internal form, and will be published
to the Organizational Forms Library. Right now, I am just testing it myself.

Thanks for any help you can give,
--
Yvetta


Sue Mosher said:
Are you resolving the recipients with Check Names before you send?

What version of Outlook? Is this a form for internal use only?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


Yvetta said:
In a custom Outlook message form, I am populating the CC field with a name
selected from a dropdown list by checking the "Set the initial value of this
field to:" checkbox on the Value properties tab of the CC field and inserting
the dropdown list name [Sponsor]. I have selected the radio button "Calculate
this formula automatically".

This works correctly. The selected name is inserted in the CC field once the
selection is made in the dropdown list. However, when the Send button is
clicked, I get an "Operation has failed" message. I have tried several
different ways of listing the names in the dropdown list, even using the SMTP
email address, but nothing works.

Can anyone help me with this problem?

Thanks in advance,
 
S

Sue Mosher [MVP-Outlook]

I was suggesting that you test first by manually clicking the Check Names button to see if the name you have in mind will resolve manually. If it doesn't resolve manually, it won't resolve programmatically either.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


Yvetta said:
I would very much appreciate any code necessary for resolving the recipients
as you mention below. I have been looking through the books I have, and
figured that is probably what I need, but have not been able to work it out
for myself. I don't have any kind of programming background, so I pretty much
stumble through that.

We are on Outlook 2003. This will be an internal form, and will be published
to the Organizational Forms Library. Right now, I am just testing it myself.
In a custom Outlook message form, I am populating the CC field with a name
selected from a dropdown list by checking the "Set the initial value of this
field to:" checkbox on the Value properties tab of the CC field and inserting
the dropdown list name [Sponsor]. I have selected the radio button "Calculate
this formula automatically".

This works correctly. The selected name is inserted in the CC field once the
selection is made in the dropdown list. However, when the Send button is
clicked, I get an "Operation has failed" message. I have tried several
different ways of listing the names in the dropdown list, even using the SMTP
email address, but nothing works.

Can anyone help me with this problem?

Thanks in advance,
 
G

Guest

Unfortunately, clicking on the Check Names button does not resolve the name.
It's very confusing that it would not even send to a valid email address.
I'll have to rethink this and see if I can come up with a different way of
accomplishing what the user wants.

Anyway, thanks for your time. It's great to have this forum and people like
yourself who are willing to help.
--
Yvetta


Sue Mosher said:
I was suggesting that you test first by manually clicking the Check Names button to see if the name you have in mind will resolve manually. If it doesn't resolve manually, it won't resolve programmatically either.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


Yvetta said:
I would very much appreciate any code necessary for resolving the recipients
as you mention below. I have been looking through the books I have, and
figured that is probably what I need, but have not been able to work it out
for myself. I don't have any kind of programming background, so I pretty much
stumble through that.

We are on Outlook 2003. This will be an internal form, and will be published
to the Organizational Forms Library. Right now, I am just testing it myself.
In a custom Outlook message form, I am populating the CC field with a name
selected from a dropdown list by checking the "Set the initial value of this
field to:" checkbox on the Value properties tab of the CC field and inserting
the dropdown list name [Sponsor]. I have selected the radio button "Calculate
this formula automatically".

This works correctly. The selected name is inserted in the CC field once the
selection is made in the dropdown list. However, when the Send button is
clicked, I get an "Operation has failed" message. I have tried several
different ways of listing the names in the dropdown list, even using the SMTP
email address, but nothing works.

Can anyone help me with this problem?

Thanks in advance,
 
S

Sue Mosher [MVP-Outlook]

It would certainly be possible with code behind the form if you want to go that route.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


Yvetta said:
Unfortunately, clicking on the Check Names button does not resolve the name.
It's very confusing that it would not even send to a valid email address.
I'll have to rethink this and see if I can come up with a different way of
accomplishing what the user wants.

Anyway, thanks for your time. It's great to have this forum and people like
yourself who are willing to help.
--
Yvetta


Sue Mosher said:
I was suggesting that you test first by manually clicking the Check Names button to see if the name you have in mind will resolve manually. If it doesn't resolve manually, it won't resolve programmatically either.
Yvetta said:
I would very much appreciate any code necessary for resolving the recipients
as you mention below. I have been looking through the books I have, and
figured that is probably what I need, but have not been able to work it out
for myself. I don't have any kind of programming background, so I pretty much
stumble through that.

We are on Outlook 2003. This will be an internal form, and will be published
to the Organizational Forms Library. Right now, I am just testing it myself.
In a custom Outlook message form, I am populating the CC field with a name
selected from a dropdown list by checking the "Set the initial value of this
field to:" checkbox on the Value properties tab of the CC field and inserting
the dropdown list name [Sponsor]. I have selected the radio button "Calculate
this formula automatically".

This works correctly. The selected name is inserted in the CC field once the
selection is made in the dropdown list. However, when the Send button is
clicked, I get an "Operation has failed" message. I have tried several
different ways of listing the names in the dropdown list, even using the SMTP
email address, but nothing works.

Can anyone help me with this problem?

Thanks in advance,
 
G

Guest

I'd definitely be interested if you could help me out with that.
--
Yvetta


Sue Mosher said:
It would certainly be possible with code behind the form if you want to go that route.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


Yvetta said:
Unfortunately, clicking on the Check Names button does not resolve the name.
It's very confusing that it would not even send to a valid email address.
I'll have to rethink this and see if I can come up with a different way of
accomplishing what the user wants.

Anyway, thanks for your time. It's great to have this forum and people like
yourself who are willing to help.
--
Yvetta


Sue Mosher said:
I was suggesting that you test first by manually clicking the Check Names button to see if the name you have in mind will resolve manually. If it doesn't resolve manually, it won't resolve programmatically either.
I would very much appreciate any code necessary for resolving the recipients
as you mention below. I have been looking through the books I have, and
figured that is probably what I need, but have not been able to work it out
for myself. I don't have any kind of programming background, so I pretty much
stumble through that.

We are on Outlook 2003. This will be an internal form, and will be published
to the Organizational Forms Library. Right now, I am just testing it myself.


In a custom Outlook message form, I am populating the CC field with a name
selected from a dropdown list by checking the "Set the initial value of this
field to:" checkbox on the Value properties tab of the CC field and inserting
the dropdown list name [Sponsor]. I have selected the radio button "Calculate
this formula automatically".

This works correctly. The selected name is inserted in the CC field once the
selection is made in the dropdown list. However, when the Send button is
clicked, I get an "Operation has failed" message. I have tried several
different ways of listing the names in the dropdown list, even using the SMTP
email address, but nothing works.

Can anyone help me with this problem?

Thanks in advance,
 
G

Guest

Strange thing happened. I was testing another part of this form and had
clicked on Run This Form, then I had to step away from my desk for a while.
When I came back, the name had been resolved. Apparently, there is a timing
factor somehow involved. Any thoughts on that? Anyway to have it resolve more
quickly?
--
Yvetta


Yvetta said:
I'd definitely be interested if you could help me out with that.
--
Yvetta


Sue Mosher said:
It would certainly be possible with code behind the form if you want to go that route.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


Yvetta said:
Unfortunately, clicking on the Check Names button does not resolve the name.
It's very confusing that it would not even send to a valid email address.
I'll have to rethink this and see if I can come up with a different way of
accomplishing what the user wants.

Anyway, thanks for your time. It's great to have this forum and people like
yourself who are willing to help.
--
Yvetta


:

I was suggesting that you test first by manually clicking the Check Names button to see if the name you have in mind will resolve manually. If it doesn't resolve manually, it won't resolve programmatically either.
I would very much appreciate any code necessary for resolving the recipients
as you mention below. I have been looking through the books I have, and
figured that is probably what I need, but have not been able to work it out
for myself. I don't have any kind of programming background, so I pretty much
stumble through that.

We are on Outlook 2003. This will be an internal form, and will be published
to the Organizational Forms Library. Right now, I am just testing it myself.


In a custom Outlook message form, I am populating the CC field with a name
selected from a dropdown list by checking the "Set the initial value of this
field to:" checkbox on the Value properties tab of the CC field and inserting
the dropdown list name [Sponsor]. I have selected the radio button "Calculate
this formula automatically".

This works correctly. The selected name is inserted in the CC field once the
selection is made in the dropdown list. However, when the Send button is
clicked, I get an "Operation has failed" message. I have tried several
different ways of listing the names in the dropdown list, even using the SMTP
email address, but nothing works.

Can anyone help me with this problem?

Thanks in advance,
 
S

Sue Mosher [MVP-Outlook]

You should be able to resolve names manually by clicking the Check Names button on the toolbar. What happens when you try?

Assuming the user can choose only one sponsor, you could put this code in the Item_Send event handler for the form:

Function Item_Send()
Const olCC = 2
Set recip = Item.Recipients.Add(Item.UserProperties("Sponsor"))
If recip.Resolve Then
recip.Type = olCc
Else
Item_Send = False
recip.Delete
MsgBox "The sponsor name -- " & _
Item.UserProperties("Sponsor") & _
" -- could not be resolved to an address."
End If
End Function

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


Yvetta said:
Strange thing happened. I was testing another part of this form and had
clicked on Run This Form, then I had to step away from my desk for a while.
When I came back, the name had been resolved. Apparently, there is a timing
factor somehow involved. Any thoughts on that? Anyway to have it resolve more
quickly?
--
Yvetta


Yvetta said:
I'd definitely be interested if you could help me out with that.
--
Yvetta


Sue Mosher said:
It would certainly be possible with code behind the form if you want to go that route.

Unfortunately, clicking on the Check Names button does not resolve the name.
It's very confusing that it would not even send to a valid email address.
I'll have to rethink this and see if I can come up with a different way of
accomplishing what the user wants.

Anyway, thanks for your time. It's great to have this forum and people like
yourself who are willing to help.
--
Yvetta


:

I was suggesting that you test first by manually clicking the Check Names button to see if the name you have in mind will resolve manually. If it doesn't resolve manually, it won't resolve programmatically either.

I would very much appreciate any code necessary for resolving the recipients
as you mention below. I have been looking through the books I have, and
figured that is probably what I need, but have not been able to work it out
for myself. I don't have any kind of programming background, so I pretty much
stumble through that.

We are on Outlook 2003. This will be an internal form, and will be published
to the Organizational Forms Library. Right now, I am just testing it myself.


In a custom Outlook message form, I am populating the CC field with a name
selected from a dropdown list by checking the "Set the initial value of this
field to:" checkbox on the Value properties tab of the CC field and inserting
the dropdown list name [Sponsor]. I have selected the radio button "Calculate
this formula automatically".

This works correctly. The selected name is inserted in the CC field once the
selection is made in the dropdown list. However, when the Send button is
clicked, I get an "Operation has failed" message. I have tried several
different ways of listing the names in the dropdown list, even using the SMTP
email address, but nothing works.

Can anyone help me with this problem?

Thanks in advance,
 
G

Guest

Sorry it has taken me so long to get back to you on this. I had to drop this
for awhile to work on other projects.

This script worked perfectly. What a relief for me and my customer. Thanks
so much for your help.
--
Yvetta


Sue Mosher said:
You should be able to resolve names manually by clicking the Check Names button on the toolbar. What happens when you try?

Assuming the user can choose only one sponsor, you could put this code in the Item_Send event handler for the form:

Function Item_Send()
Const olCC = 2
Set recip = Item.Recipients.Add(Item.UserProperties("Sponsor"))
If recip.Resolve Then
recip.Type = olCc
Else
Item_Send = False
recip.Delete
MsgBox "The sponsor name -- " & _
Item.UserProperties("Sponsor") & _
" -- could not be resolved to an address."
End If
End Function

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


Yvetta said:
Strange thing happened. I was testing another part of this form and had
clicked on Run This Form, then I had to step away from my desk for a while.
When I came back, the name had been resolved. Apparently, there is a timing
factor somehow involved. Any thoughts on that? Anyway to have it resolve more
quickly?
--
Yvetta


Yvetta said:
I'd definitely be interested if you could help me out with that.
--
Yvetta


:

It would certainly be possible with code behind the form if you want to go that route.

Unfortunately, clicking on the Check Names button does not resolve the name.
It's very confusing that it would not even send to a valid email address.
I'll have to rethink this and see if I can come up with a different way of
accomplishing what the user wants.

Anyway, thanks for your time. It's great to have this forum and people like
yourself who are willing to help.
--
Yvetta


:

I was suggesting that you test first by manually clicking the Check Names button to see if the name you have in mind will resolve manually. If it doesn't resolve manually, it won't resolve programmatically either.

I would very much appreciate any code necessary for resolving the recipients
as you mention below. I have been looking through the books I have, and
figured that is probably what I need, but have not been able to work it out
for myself. I don't have any kind of programming background, so I pretty much
stumble through that.

We are on Outlook 2003. This will be an internal form, and will be published
to the Organizational Forms Library. Right now, I am just testing it myself.


In a custom Outlook message form, I am populating the CC field with a name
selected from a dropdown list by checking the "Set the initial value of this
field to:" checkbox on the Value properties tab of the CC field and inserting
the dropdown list name [Sponsor]. I have selected the radio button "Calculate
this formula automatically".

This works correctly. The selected name is inserted in the CC field once the
selection is made in the dropdown list. However, when the Send button is
clicked, I get an "Operation has failed" message. I have tried several
different ways of listing the names in the dropdown list, even using the SMTP
email address, but nothing works.

Can anyone help me with this problem?

Thanks in advance,
 

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