PDA

View Full Version : Desperate for Help!!!



karrims
07-10-2009, 09:02 AM
I need to set the To field of a custom form to auto populate based on multiple criteria in other fields. For example: if the use choose the combination of "Add", "Responsible", and "Client", I want the To field to automatically populate joe.smith@email.com. Can anyone help me with this?!?:help

OTWarrior
07-28-2009, 02:44 AM
could you supply a sample of what you have already? what code do you have? are you just after the code for adding data to the .to field? if so use something like this: (you may need to add references to the cdo runtime.

Sub emailMaker(Item As Outlook.MailItem)
On Error GoTo err1
Set oSession = CreateObject("MAPI.Session")
oSession.Logon "", "", False, False

if criteria = value then
item.To = "joe.smith@email.com"
else
item.To = "name@email.com"
end if

Exit Sub

err1:
MsgBox Err.Description
End Sub


Does this help?