Command BUtton - Forward current form

D

Daniel Reyes

I have several forms that I created a few years ago using MS Outlook 98. I
am now in the process recreating the forms using MS Outlook 2003. In the
form I have the user fill out all the fields in the page. I then have them
press a command button at the bottom of the form so it will forward this
request to a few people in a group. This is what I use now:

'-=-=-=-=-=-=-=-=-=-
'Sub Forward1
' Item.To = "Daniel REyes"
' Item.SentOnBehalfOfName=strCAD
' Item.Send
'End Sub
'-=-=-=-=-=-=-=-=-=-

What do I have to do to use this in MS Outlook 2003? I am not a vb
programmer so I am not sure what to do.
 
S

Sue Mosher [MVP-Outlook]

First of all, you're forwarding the current *item* not the form. The form is
the UI/code template. The item is the data record, a message in this case.

Second, the main difference between Outlook 98 and Outlook 2003 is the
security for forms scripts. Script doesn't run in unpublished forms. See
http://www.outlookcode.com/d/secforms.htm
The simplest forwarding code for a command button named cmdForward would
look something like:

Sub cmdForward_Click()
' some code to get strCAD
Set objItem = Item.Forward
With objItem
.To = "Daniel REyes"
.SentOnBehalfOfName=strCAD
.Send
End With
End Sub

Or did you mean "send the current item" when you wrote "forward"? If so, you
might need to fill us in on the details of how you plan to have people use
this form.
 
D

Daniel Reyes

I think that will help. Let me give you an Idea on what the whole process it
like.

1. A CD is FedEx to our site and delivered to our Control Rm.
2. Control Rm. Personnel inform the Account Rep that their CD with x number
of zipped files is here.
3. The Account Rep. will the fill out a form called PC Conversion where they
fill out several fields
a. Filename
b. File size
c. Estimated Number of records in file
d. Convert data for Mainframe processing
4. This form has two pages and the Account Rep sees only page 1.
5. It used to be that they would fill in the TO: address but they kept
getting the wrong names in there. So, a cmdbutton was created that would
“forward†the form/Item to the right group or person.
6. Once the form is “forwarded†to the Control Rm. The code should now
“Show†the second page.

Yep, Once I get this worked out I need to start working on the HIDESHOW PAGE
section.

Thank you for your help.
 
S

Sue Mosher [MVP-Outlook]

So, you're not forwarding at all. You're sending the original item. The code
a command button to do that would be:

Sub CommandButton1_Click()
Item.To = "Daniel REyes"
Item.SentOnBehalfOfName=strCAD
Item.Send
End Sub

just as you had it originally, the difference being that the code above is
an event handler for the Click event for a command button on the form named
CommandButton1.

Instead of page 1 and page 2, you may find it easier to use a single page
and separate compose and read layouts.
--
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