Re: making frames dissapear using checkboxes
- From: daphnejean77 <daphnejean77@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 27 Apr 2007 07:24:02 -0700
I am trying to start over this morning I am still having trouble writing
the Code for the CustomPropertyChange I don't know what I am missing. Can
you maybe give me an example code to start with - I haven't been able to
piece together the right pieces and I can't seem to find anything to compare
the code to.
"daphnejean77" wrote:
Ok, so I actually understood more than I thought I did. I have a checkbox.
already created with the property to tie it to the frame. Now I am really
struggling with writing code for Custom Property Change and the Open event.
I don't have permission to publish them to the exchange server, but once the
forms are created they will be published by IT to the exchange server. For
the moment I publish them to my personal forms to make sure they work
properly.
I have been going over and over the link for writing CustomPropertyChange
code and it is where I seem to be getting stuck for some reason.
"Sue Mosher [MVP-Outlook]" wrote:
I am not understanding how to create a Yes/No Property that will store information about the frame.
Let's try breaking this down into two concepts. I think may help you put it together.
You know how to create a yes/no property, right? Just click the New button on the Field Chooser, choose the type of property and give it a name. You might call it FrameVisible to remind you of what the property means. (If you already have a property you're using, that's fine, too. We can go with that. I think it might be helpful, though, for you to think of even an existing yes/no property as the "FrameVisible" property.)
Now you have a place to store information about the state of the frame. So far so good? The next question is: How does the property become associated with the frame's visibility? In two ways -- the user needs a way to interact with the property, and the form needs code that use the property value to change the Visibility property of the frame. You can take care of the first with a check box. Drag the property from the Field Chooser to the form, and Outlook will create a check box automatically. For the second, you need to write code in two places -- the CustomPropertyChange event and the Open event. More on that in our next installment. For now, I just want to make sure you have the "big picture," with diagrammed out, looks something like this:
User > check box > property
Property > code > frame visibility
In other words, the user interacts with the check box to change the property value, and the code uses the property value to alter the frame's visibility.
With me so far?
BTW, you said this is a custom email form. Is it for internal use only? Do you have permission to publish forms to the Organizational Forms library on your Exchange Server?
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"daphnejean77" <daphnejean77@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:403E1A85-E297-4795-87DE-C986F73C1EFC@xxxxxxxxxxxxxxxx
Thank you for your help you have been truelly wonderful in all of this. I am
still having trouble, but it gets clearer from time to time. I do not know
where I am going wrong today or why these codes are not working but I have
two codes that are holding up the entirety of my forms. I have written the
below code so far for the Item_Open event. Believe it or not though, I am not
understanding how to create a Yes/No Property that will store information
about the frame.
Sub Item_Open
If CheckBox4 = ?????
Set myinspector = Item.GetInspector
Set myPage1 = myInspector.ModifiedFormPages("Message")
Set frame4 = myPage1.Controls("frame4")
Set Checkbox5 = myPage1.Controls("CheckBox5")
frame4.Visible = Checkbox5.Value
End Sub
How do I make this code work?
How do I set the Yes/No property? Does the check box do that? How do I
link them together? I guess I don't understand this component of everything.
"Sue Mosher [MVP-Outlook]" wrote:
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"daphnejean77" <daphnejean77@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:637CC2DB-0F6F-4E20-8F19-315A0B36BFE4@xxxxxxxxxxxxxxxx
How do I design a frame to have a Yes/No property?
A frame cannot have a yes/no property. What you need is a yes/no property to store information about the state of the frame (visible/hidden).
Also when you refer to
running a similar code in the Item_Open event handler, I should be writing a
code that hides the appropriate frames once the email is opened?
Right. That's what you want, isn't it?
If you could offer som advice hopefully it will unjumble my head.
The best advice I can offer is not to try to do everything at once. You may even want to step away from the keyboard and sketch out your form's needs with pencil and paper. Make a note of what information the form might need to store in an individual item so that the person who opens that item will see what you want them to see. Remember that Outlook does not persist the look of a form between sessions. When the user opens the item, Outlook starts with whatever the published form looks like.
"Sue Mosher [MVP-Outlook]" wrote:
What specifically don't you understand? We've already covered the yes/no property in your other thread.
"daphnejean77" <daphnejean77@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:DD9E76FD-405C-403D-933B-A39DD9673FDD@xxxxxxxxxxxxxxxx
I am sorry, but I am still getting used to some of the functions and fields.
I am confused about what you are saying below. I don't even know where to
begin for either suggestion. Can you help?
"Sue Mosher [MVP-Outlook]" wrote:
Run similar code in the Item_Open event handler. You'll also need to change the design and add a yes/no property that can store the information that the frame should be visible or not visible.
"daphnejean77" <daphnejean77@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:0CC29D02-0376-4CDD-856D-F333D8C1F69B@xxxxxxxxxxxxxxxx
I have a code to cause frames to disapear/reappear when a checkbox is marked
or unmarked. I am using this code for a custom email form I am designing.
The frames are successfully staying hidden and reappearing when asked to,
however once I send the email, all frames are visible to the receiver. How
can I modify this code or the frames to make the correct frames stay hidden.
Here is the code I have been using:
Sub CheckBox3_Click()
Set myinspector = Item.GetInspector
Set myPage1 = myInspector.ModifiedFormPages("Message")
Set frame2 = myPage1.Controls("frame2")
Set Checkbox3 = myPage1.Controls("CheckBox3")
frame2.Visible = Checkbox3.Value
End Sub
Thank you,
Daphne
- Follow-Ups:
- Re: making frames dissapear using checkboxes
- From: Sue Mosher [MVP-Outlook]
- Re: making frames dissapear using checkboxes
- References:
- Re: making frames dissapear using checkboxes
- From: Sue Mosher [MVP-Outlook]
- Re: making frames dissapear using checkboxes
- From: Sue Mosher [MVP-Outlook]
- Re: making frames dissapear using checkboxes
- From: Sue Mosher [MVP-Outlook]
- Re: making frames dissapear using checkboxes
- From: daphnejean77
- Re: making frames dissapear using checkboxes
- From: Sue Mosher [MVP-Outlook]
- Re: making frames dissapear using checkboxes
- From: daphnejean77
- Re: making frames dissapear using checkboxes
- Prev by Date: Re: Question on Custom Form and Protected Fields
- Next by Date: Re: making frames dissapear using checkboxes
- Previous by thread: Re: making frames dissapear using checkboxes
- Next by thread: Re: making frames dissapear using checkboxes
- Index(es):
Relevant Pages
|