Outlook and Form Issue

J

Jade

Hi,

I designed a form in outlook using the post template and added the
following code:

Function Item_Open()
IntAns=MsgBox("Would you like to open a new account",_
vbQuestion+vbYesNo,"Account Request")
If IntAns=vbYes then
Set myInspector=Item.GetInspector
Set myPage=myInspector.ModifiedFormPages.Item("CusNum")
Set fraOpen=myPage.Controls.Item("fraOpen")
fraOpen.Visible=True
End If
If IntAns=vbNo Then
Set myInspector=Item.GetInspector
Set myPage=myInspector.ModifiedFormPages.Item("CusNum")
Set fraChange=myPage.Controls.Item("fraChange")
fraChange.Visible=True
End If
End Function

The problem I'm facing are on two levels. First when I work with the
form in my laptop it works fine however none of the frames show on the
read layout portion when posted. Secondly, I re-created the exact form
in my computer at work and when I try to run the form it crashes
Outlook (closes and restarts itself) when you attempt to Post. The
code runs well on both environments, it's just when you post or attempt
to post that the form exhibits these quirks. All I would like to do is
ask the question during the composing layout and show the results on
the read layout.

Any recommendations would be greatly appreciated.

Thank you.

Jade
 
S

Sue Mosher [MVP-Outlook]

Did you create a read layout with the frames? Where is the form published? What version of Outlook?

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

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

Jade

Hi Sue,

Wow...it's a pleasure meeting you in this usergroup. I've been reading
your book for guidance in this project. I've run into a bit of a loop.
I realize that I'm either missing a step or am not using the proper
step. The form wasn't published but in design mode at the time and yes
I created a Read Layout which has a slightly different layout but all
of the fields in the Compose Layout. I recently published it to my
Personal Library and realize that I have another problem. I believe
it's one-off......

The script itself should only run when the form is in compose layout.
However, now that I've published it...whenever I post a new form and go
back to open the original form the message box appears prompting me for
a new form. Perhaps Function_Item Open() is not the function I
require. The manner in which the whole process should run would be
that the form message box appears upon initial opening then once it's
posted the Read Layout is slightly a different layout and can be
forwarded to other people. Basically the script should only work upon
initial activation. I'm working with Outlook 2003.

I truly appreciate any assistance you can offer.

Jade
 
S

Sue Mosher [MVP-Outlook]

Item_Open fires whenever you open an item, regardless of whether it's a new item or a previously created one. Check the Size property to determine which you have. A new item will have Item.Size = 0.
The manner in which the whole process should run would be
that the form message box appears upon initial opening then once it's
posted the Read Layout is slightly a different layout and can be
forwarded to other people.

I don't understand what you have in mind. A layout isn't what you forward. What's forwarded is the item, in other words the data. If you want to control the UI of the item the user receives, that item is going to need to be using a custom form definition that has code behind it to set the UI when the recipient opens the item, based on some state data that you store in the item. And that means it will need to be published to the Organizational Forms library.

I also don't understand why you're using a post form when what you seem to want to create a message to recipients. What part of the "big picture" are we missing?
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

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


Jade said:
Hi Sue,

Wow...it's a pleasure meeting you in this usergroup. I've been reading
your book for guidance in this project. I've run into a bit of a loop.
I realize that I'm either missing a step or am not using the proper
step. The form wasn't published but in design mode at the time and yes
I created a Read Layout which has a slightly different layout but all
of the fields in the Compose Layout. I recently published it to my
Personal Library and realize that I have another problem. I believe
it's one-off......

The script itself should only run when the form is in compose layout.
However, now that I've published it...whenever I post a new form and go
back to open the original form the message box appears prompting me for
a new form. Perhaps Function_Item Open() is not the function I
require. The manner in which the whole process should run would be
that the form message box appears upon initial opening then once it's
posted the Read Layout is slightly a different layout and can be
forwarded to other people. Basically the script should only work upon
initial activation. I'm working with Outlook 2003.

Did you create a read layout with the frames? Where is the form published? What version of Outlook?

--
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