Displaying a drop-down of FROM choices...

J

John Smith

I'm trying to create a simple Outlook form that allows the user to send
messages as another person via a simple drop-down list. Why is that so
seemingly difficult? The users already have permission to send as the
chosen mailbox. In fact, if I simply add the stock FROM field to my form,
the user can type in the mailbox they wish to send as and it works fine.

However, I want to make it easy for them to select the mailbox to send as.
I first tried dragging the stock FROM field to the new form and placing a
combo-box next to it. The combo-box is filled with the e-mail address to
send as. Upon selection, the value of the FROM field text box should
change. However, it's not letting me access the value of the FROM field
text box. I put a regular textbox on the form and made sure my code could
change its value---and it did.

I can't find much help for this with google. I've found articles from MS
and cdolive that talk about programmatically sending e-mail as another user
using CDO but I figured there's got to be an eaiser way to accomplish what I
want to do. I just haven't found it yet.

Thanks for any insight on this.
 
S

Sue Mosher [MVP-Outlook]

From is a special field/control. You can't use it in the way you expect.

Instead, you would need to provide an unbound combo box, fill it with names or aliases, and then in the form's Item_Send event handler, set the SentOnBehalfOfName property to the selection from the combo box.
 
J

John Smith

Thanks for responding Sue. That works but is not what I'm looking for. I
do not want the message to read "sent on behalf of ...". It seems to me
that, since the user can modify the from field text box by hand, it could be
done programatically. I have seen CDO examples of sending a message as
someone else but that's a bit more work than I wanted to put in to this for
now.

Thanks for your help and I will appreciate any other ideas you may have
regarding this.


From is a special field/control. You can't use it in the way you expect.

Instead, you would need to provide an unbound combo box, fill it with names
or aliases, and then in the form's Item_Send event handler, set the
SentOnBehalfOfName property to the selection from the combo box.
 
S

Sue Mosher [MVP-Outlook]

There are many, many things that can be done in the UI that are not exposed programmatically, at least not directly.

The message will not read "on behalf of" if the user has Send As permission on the other Exchange mailbox. This is one case where the UI and programmatic behavior are the same.
 
J

John Smith

Granting "Send As" permission solved that issue as you stated. I am happy
now.

Thanks again, Sue.


There are many, many things that can be done in the UI that are not exposed
programmatically, at least not directly.

The message will not read "on behalf of" if the user has Send As permission
on the other Exchange mailbox. This is one case where the UI and
programmatic behavior are the same.
 
J

John Smith

Okay, I'm almost there. I have one more question. What I'm trying to do is
create e-mail templates for our sales department so they can send out
e-mails rather quickly. Since the information they send is mostly the same
for each customer, I thought I would try my hand at creating templates for
them. The templates are to be stored in a public folder. As I mentioned
before, the templates are custom forms that have a drop-down from and to
comboboxes. Now the only thing that I can't figure out is how I should
store them.

I want them to appear as items in the public folder. For example, "OrderX"
would be a template with the body containing, "thank for you for ordering
product X" and "OrderY" would contain "thank you for ordering product Y".
Of course when I publish the forms to the folder, they don't appear as
items---I have to open them through the TOOLS / ACTIONS method. If I simply
save them as templates, the vbscript does not work but they do show up as
items. That's where I'm stuck.

I found the Formlauncher code on
http://www.outlookcode.com/d/forms/formlauncher.htm . That would work
perfectly if I could save the message details when I create the new form
using the Launcher app. Otherwise, it simply creates a blank custom form.

Any thought about this? Thanks again for your time.







There are many, many things that can be done in the UI that are not exposed
programmatically, at least not directly.

The message will not read "on behalf of" if the user has Send As permission
on the other Exchange mailbox. This is one case where the UI and
programmatic behavior are the same.

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

John Smith

Nevermind. I figured out what I needed.

John Smith said:
Okay, I'm almost there. I have one more question. What I'm trying to do
is create e-mail templates for our sales department so they can send out
e-mails rather quickly. Since the information they send is mostly the
same for each customer, I thought I would try my hand at creating
templates for them. The templates are to be stored in a public folder.
As I mentioned before, the templates are custom forms that have a
drop-down from and to comboboxes. Now the only thing that I can't figure
out is how I should store them.

I want them to appear as items in the public folder. For example,
"OrderX" would be a template with the body containing, "thank for you for
ordering product X" and "OrderY" would contain "thank you for ordering
product Y". Of course when I publish the forms to the folder, they don't
appear as items---I have to open them through the TOOLS / ACTIONS method.
If I simply save them as templates, the vbscript does not work but they do
show up as items. That's where I'm stuck.

I found the Formlauncher code on
http://www.outlookcode.com/d/forms/formlauncher.htm . That would work
perfectly if I could save the message details when I create the new form
using the Launcher app. Otherwise, it simply creates a blank custom form.

Any thought about this? Thanks again for your time.







There are many, many things that can be done in the UI that are not
exposed programmatically, at least not directly.

The message will not read "on behalf of" if the user has Send As
permission on the other Exchange mailbox. This is one case where the UI
and programmatic behavior are the same.

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

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