My Form Pages are not getting hidden

  • Thread starter Thread starter lalthan
  • Start date Start date
L

lalthan

I have created a mail form with 4 pages. Now, by default I have hidden
all the forms except for the default mail page. As per the value
selected by the user, these form pages were populated.
I wrote a script using either one of the two mentioned below:
Sub Item_CustomPropertyChange(ByVal Name)
Function Item_Send()

Now, as per the value I select from the Dropdown box, only the
concerned Form Page becomes visible. But when I send it out, the
recipient receives only the first page (ie. Mail page) and not the
other visible page.

I rerun the whole thing in the opposite way. This time, I made all the
pages visible and as per my dropdown value, all the other Form Page
becomes hidden. This works for me but when I send it out again, the
recipient receives the form with all the four pages visible.

Any idea why the same view that I get is not received by the recipient
? I have not set a separate READ page for the other Pages except the
Mail Page.
 
I rerun the whole thing in the opposite way. This time, I made all the
pages visible and as per my dropdown value, all the other Form Page
becomes hidden. This works for me but when I send it out again, the
recipient receives the form with all the four pages visible.
Did you save the list-value of the drop-down control to an Array type
Outlook variable, and the index-value to a numeric type Outlook
variable?

Do you re-load and initialize the drop-down control when it is opened in
read mode?
 
The code I use is as below:

Function Item_Open()
MyValue = item.UserProperties("request")
Set myInspector = Item.GetInspector
Set myPages = myInspector.ModifiedFormPages
If MyValue <> "" Then
If MyValue = "1" Then
myInspector.ShowFormPage("1")
myInspector.HideFormPage("2")
myInspector.HideFormPage("3")
myInspector.HideFormPage("4")
ElseIf MyValue = "2" Then
myInspector.ShowFormPage("2")
myInspector.HideFormPage("1")
myInspector.HideFormPage("3")
myInspector.HideFormPage("4")
ElseIf MyValue = "3" Then
myInspector.ShowFormPage("3")
myInspector.HideFormPage("1")
myInspector.HideFormPage("2")
myInspector.HideFormPage("4")
ElseIf MyValue = "4" Then
myInspector.ShowFormPage("4")
myInspector.HideFormPage("1")
myInspector.HideFormPage("2")
myInspector.HideFormPage("3")
Else
myInspector.ShowFormPage("1")
myInspector.ShowFormPage("2")
myInspector.ShowFormPage("3")
myInspector.ShowFormPage("4")
End If
End If
End Function

Now, the recipient is still seeing all 4 pages. Also, on Reply by the
recipient, the form is lost. The form is still attached only if the
recipient forwards it back to the original sender or forwards it to
another person.

I have also tried the Sub Item_CustomPropertyChange(ByVal Name) and
added the above code, but the same is working only for the original
sender.
 
<[email protected]>
<[email protected]>
Newsgroups: microsoft.public.outlook.program_forms
NNTP-Posting-Host: pool-71-113-55-11.sttlwa.dsl-w.verizon.net 71.113.55.11
Lines: 1
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news-in-01.newsfeed.easynews.com!easynews.com!easynews!newsfeed.news2me.com!newshub.sdsu.edu!msrtrans!TK2MSFTFEEDS01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP02.phx.gbl
Xref: number1.nntp.dca.giganews.com microsoft.public.outlook.program_forms:79300

Now, the recipient is still seeing all 4 pages. Also, on Reply by the
recipient, the form is lost. The form is still attached only if the
recipient forwards it back to the original sender or forwards it to
another person.

I have also tried the Sub Item_CustomPropertyChange(ByVal Name) and
added the above code, but the same is working only for the original
sender.
What you are not showing is how you save a value to
item.UserProperties("request"). From your description of the pages
that are seen, I infer that there is no value in
item.UserProperties("request") and the code is falling into the else
clause.

Other questions that have not been addressed:
Where is the form published?
Does the recipient have access to it?
 
What you are not showing is how you save a value to
item.UserProperties("request"). From your description of the pages
that are seen, I infer that there is no value in
item.UserProperties("request") and the code is falling into the else
clause.
request is the value of the dropdown assigned for the
combobox (name - combobox1). On the properties page for Combobox1, on
the value tab, I have assigned a new field named "request"
(Property to use As Value)
Where is the form published?
The Form is published on a public folder
Does the recipient have access to it?
The recipients have access to this folder.

Also, when I send a reply mail from the recipient, the form does not
get displayed. The form gets displayed only if I forward it again from
the recipient to another user.
 
<[email protected]>
<[email protected]>
Newsgroups: microsoft.public.outlook.program_forms
NNTP-Posting-Host: pool-71-113-55-11.sttlwa.dsl-w.verizon.net 71.113.55.11
Lines: 1
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!news.alt.net!msrtrans!TK2MSFTFEEDS01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP02.phx.gbl
Xref: number1.nntp.dca.giganews.com microsoft.public.outlook.program_forms:79303

The Form is published on a public folder

The recipients have access to this folder.

Also, when I send a reply mail from the recipient, the form does not
get displayed. The form gets displayed only if I forward it again from
the recipient to another user.
Well, unless you have code in the Item-open event to add a new instance
of your custom message and then add the contents of the incoming message
to it, your recipients will probably never see it displayed in the
custom form. Exchange/Outlook will look for the custom form first in
the Exchange Organizational Forms library, then in the local cache, and
then in the personal forms library, if it exists. It does not search
through public folders to find the custom form. The solution is to move
the form definition from the public folder to the Exchange Org Forms
Library. Your recipients will then be able to find the custom form.

Now, back to "request". From what you have said, I infer that the text
of what is selected in the drop-down list is getting saved to the
variable you created. This will not evaluate to a numerical value when
you try to use it in your code. What you need to do is create two
custom fields, one of type array, and one of type numeric. You need to
save the Array value of the combo-box to the field of type array, and
the index value of the combo-box to the numeric-type field. The
Combo-box should be set as unbound, and you have to provide the code, in
the click-event handler, to save to save these two values. Then, when
the item is opened at the recipient, you need to provide code to
reconstruct the state of the combo-box from the saved fields.

Review these pages for sample code and how-to information:

Syntax for Microsoft Outlook property and control values and events
5/10/2006
Correct syntax for accessing Microsoft Outlook property and control
values and writing events that respond to changes in properties or
control values
http://www.outlookcode.com/archive0/d/propsyntax.htm - 31 KB

To populate a combo box on a Microsoft Outlook form 5/10/2006
Microsoft Outlook VBScript code sample to populate a combo or list box
on an Outlook form using an ADO disconnected recordset
http://www.outlookcode.com/d/code/popcombobox.htm - 20 KB

Controls on Microsoft Outlook Custom Forms 5/10/2006
Tips, tricks and other resources for using controls on Microsoft
Outlook forms
http://www.outlookcode.com/d/formcontrols.htm - 35 KB
 
Dear Hollis,

Thanks very much for such an exhaustive explanation. Now, my only
problem is how to set create two
custom fields, one of type array, and one of type numeric. Can you show
me a few example while I go through the syntax from www.outlookcode.com
:)

Thanks
 
<[email protected]>
<[email protected]>
<[email protected]>
Newsgroups: microsoft.public.outlook.program_forms
NNTP-Posting-Host: pool-71-113-55-11.sttlwa.dsl-w.verizon.net 71.113.55.11
Lines: 1
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!msrtrans!TK2MSFTFEEDS01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP03.phx.gbl
Xref: number1.nntp.dca.giganews.com microsoft.public.outlook.program_forms:79320

Just to add to the below field, I don't think I have any unbound field.
Of course not. Unbound refers only to controls, which are unbound, or
bound to fields. What that means is the following:
A bound control has no click event available to the programmer. The
click event really does happen but it is consumed by the code that was
set up when the control was bound to the field. You don't see that code,
but it is there, somewhere. When you hit enter on a bound control, the
value of the control is automatically transferred to field that is bound
to the control. This does not happen with an unbound control. When you
hit enter with an unbound control, like a button, processing control is
switched to a click-event handler. You can then put any code you like
into the click-event and do a lot of things. But, if you do not also
save the value of the control to a field, it is lost when the form is
closed.
 
<[email protected]>
<[email protected]>
Newsgroups: microsoft.public.outlook.program_forms
NNTP-Posting-Host: pool-71-113-55-11.sttlwa.dsl-w.verizon.net 71.113.55.11
Lines: 1
Path: number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!msrtrans!TK2MSFTFEEDS01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP03.phx.gbl
Xref: number1.nntp.dca.giganews.com microsoft.public.outlook.program_forms:79321

Now, my only
problem is how to set create two
custom fields, one of type array, and one of type numeric. Can you show
me a few example while I go through the syntax from www.outlookcode.com
:)
You do not really want to create a field using code. Just click the
field chooser control, click the new button, choose the User Defined
Field in the Folder category, then create a control. You will be forced
to select a type for the field--choose the one that sounds like an array
for one, and numeric for the other.
 
Back
Top