Sure, that's possible. Remove the address controls from the form and try
this code:
Function Item_Open()
If Item.Sent <> False Then
Item.To = "myaddress@mycompany.com"
Item.Recipients.ResolveAll
End If
End Function
Function Item_Send()
Item.To = "myaddress@mycompany.com"
End Function
The Item.To statement is in both events to make sure there's a recipient
already present when the user tries to send the item. This won't prevent a
user from bringing up the Address Book dialog and changing the recipients,
but the Item_Send code will override any changes they've made.
You are planning to publish this form to the Organizational Forms library or
to each user's Personal Forms library, correct?
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
"daniel_l_v" <daniellv.RemoveThis@discussions.microsoft.com> wrote in message
news:96F6BE28-D254-4AD1-81C5-15166093AF1F@microsoft.com...
> Created a simple "Phone Message" style custom Outlook 2007 form.
> Want to set the "To" field to a specific email address that customers
> cannot
> change, have not been able to do this.
>
> Can anyone advise whether the "To" field can be set programmatically prior
> to the message being sent, so that it always gets sent to the same
> recipient?
>