![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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? |
Ads |
#2
|
|||
|
|||
![]()
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 = " Item.Recipients.ResolveAll End If End Function Function Item_Send() Item.To = " 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" wrote in message ... 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? |
#3
|
|||
|
|||
![]()
Hi Sue,
Thanks for the code. I've put the code you suggested in the script editor and saved my form. However, whilst the code doesn't give any errors, it doesn't seem to actually trigger. I've put in a couple of MsgBox statesments to check, but neither seems to run. Yes - The form will be published eventually to Organizational Forms. Is there something I might me missing that could be stopping the code from actually running? Do I need any header or tags in the script to ensure it is in the correct format? Just checking, I should be putting the code in the "View Code" Script Editor, and NOT in a Visual Basic project. |
#4
|
|||
|
|||
![]()
I don't know what you mean by "saved my form." Code runs only on published
forms. You'll need to publish it to get it to work. -- 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" wrote in message ... Hi Sue, Thanks for the code. I've put the code you suggested in the script editor and saved my form. However, whilst the code doesn't give any errors, it doesn't seem to actually trigger. I've put in a couple of MsgBox statesments to check, but neither seems to run. Yes - The form will be published eventually to Organizational Forms. Is there something I might me missing that could be stopping the code from actually running? Do I need any header or tags in the script to ensure it is in the correct format? Just checking, I should be putting the code in the "View Code" Script Editor, and NOT in a Visual Basic project. |
#5
|
|||
|
|||
![]()
Sue, by "save my form" I meant exactly that, you can save a form as an OFT
file whilst working on it. I've published but still not working. Is the "Item" an object representing the message itself? I can't find "Item" in the VB Script Object Browser. |
#6
|
|||
|
|||
![]()
As I said, only published forms run code. Forms saved as .oft files don't.
Item is an intrinsic object in custom form code representing the current item, just as Application represents the running Outlook.Application object. -- 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" wrote in message ... Sue, by "save my form" I meant exactly that, you can save a form as an OFT file whilst working on it. I've published but still not working. Is the "Item" an object representing the message itself? I can't find "Item" in the VB Script Object Browser. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
form or template associated to a specific email recipient | [email protected] | Outlook - Using Forms | 3 | April 21st 09 09:03 PM |
How to Access the "To" Recipient field and update it in outlook form | Venkat M | Outlook - Using Forms | 11 | October 13th 08 08:01 PM |
"Add Field" button under "Customized Form" stop working??? | Troika | Outlook - Using Forms | 1 | March 4th 08 01:17 AM |
right click any doc & "Send To" a "Mail Recipient" won't get sent | David Grana | Outlook - Installation | 1 | February 27th 08 08:46 PM |
Rule "with specific words.." and "reply with.." works inconsistent | ppi | Outlook - Installation | 2 | February 8th 08 06:01 PM |