Forwarding a form from one user to another


D

darrylgould

Hello

I have created an Outlook form which I want to be:

1. Completed by a user
2. Forwarded to an approver
3. Then Forwarded to an administrator
4. Then Forwarded to another person

I seem to be hitting problems whenever I add a second send routine. Can
anyone help? Here is the code:

Option Explicit
'Forward to approver function
Function Item_CustomAction(ByVal Action, ByVal NewItem)
Select Case Action.Name
Case "Route"
Item_CustomAction = True
NewItem.To = "Approver1"
Case Else
Item_CustomAction = True
End Select
End Function
'The first send action
sub cmdsendPCa_Click()

Item.Actions.item("Route").Execute
Item.Close 1

end sub

'Forward to administrator function
Function Item_CustomAction(ByVal Action, ByVal NewItem)
Select Case Action.Name
Case "Routeb"
Item_CustomAction = True
NewItem.To = "Adminstrator"
Case Else
Item_CustomAction = True
End Select
End Function

'The second send action
sub cmdsendPCb_Click()

Item.Actions.item("Routeb").Execute
Item.Close 1

end sub

Hope you can help
 
Ad

Advertisements

S

Sue Mosher [MVP-Outlook]

What's the nature of the problem? Where is the form published?

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

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

darrylgould

Hi Sue

The form is an .oft at present. The code breaks whenever I try to send
the form to the Approver, using the 'cmdsendPCa_Click()' function on a
button.

Does that help?
Thanks
Darryl
 
D

darrylgould

I get this error message:

"There must be at least one name or distribution list in the To, Cc or
Bcc box"

Thanks
Darryl
 
S

Sue Mosher [MVP-Outlook]

By default no code runs on items created with .oft form templates. You must publish the form.

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

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

Sue Mosher [MVP-Outlook]

THis is normal behavior when the Send command is executed if there are no recipients yet.

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

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

Advertisements

D

darrylgould

Sue

I anticipated your response, and published the form, but it still
didn;t work.

The first route function works, until I add the routeb function. Any
ideas?

Thanks
Darryl
 
S

Sue Mosher [MVP-Outlook]

Where did you publish the form?

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

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

darrylgould

Hi Sue

I published the form to my inbox, and to Personal Forms Library.
Neither worked.

Thanks
Darryl
 
S

Sue Mosher [MVP-Outlook]

That's the problem. For a message form that has code behind it to work properly, everyone must have access to the published form. Accomplish this by publishing it in the Organizational Forms library on Exchange or to every person's Personal Forms library.

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

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

darrylgould

Sue

I don't think that is the problem, as the error occurs when I try to
use the form, even though it is published in my Personl Forms library.

Thanks anyway
Darryl
 
Ad

Advertisements

S

Sue Mosher [MVP-Outlook]

You mean when sending it to yourself? WHat's the error? (You'll get a faster answer if you include enough of the context of the earlier messages in the thread to provide the complete picture of the problem.)

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

and 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