You are here: Office-Outlook.com  / Outlook Forum

Custom Form + Outlook Folder

Home » Outlook addins and plugins development » Developer Outlook forms
Custom Form + Outlook Folder [message #415] Tue, 13 June 2006 02:06 Go to next message
BOR155
Messages: 9
Registered: June 2006
Junior Member
I want to have a block of code inside an Outlook form that will check whether
the folder from which the form is opened is "Sent Items" and if it is run
some code, and if not, run some other code.
Could someone pls tell me how to do this?
Regards
BORIS
Re: Custom Form + Outlook Folder [message #418] Tue, 13 June 2006 17:11 Go to previous messageGo to next message
BOR155
Messages: 9
Registered: June 2006
Junior Member
Sue
I am referring to the folder where the item being opened is stored...



"Sue Mosher [MVP-Outlook]" wrote:

> I wonder if you're a little confused about the difference between forms and items. A form is a UI/code template. An item is a data record. How an item displays in its own window depends on the form associated with that item.
>
> So, with that background, what is it that you're trying to find out when you refer to "the folder from which the form is opened"? Two choices:
>
> 1) the folder that the user currently looking at when they create a new item using a custom form
>
> 2) the folder where the item being opened is stored
>
> --
> 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
>
> "BOR155" <BOR155@discussions.microsoft.com> wrote in message news:8417CA37-F30E-4BCA-B6D4-BB8ED5C23046@microsoft.com...
> >I want to have a block of code inside an Outlook form that will check whether
> > the folder from which the form is opened is "Sent Items" and if it is run
> > some code, and if not, run some other code.
> > Could someone pls tell me how to do this?
> > Regards
> > BORIS
>
Re: Custom Form + Outlook Folder [message #425] Wed, 14 June 2006 23:55 Go to previous message
BOR155
Messages: 9
Registered: June 2006
Junior Member
Lovely idea and it works well. Let me share the code with everyone on this
forum. Here's what I've done:
'*****************************************
Set Page = Item.getinspector.modifiedformpages("Message")
Set myControls = Page.Controls
'Hides or displays "Finance Use Only" tab depending where the item is opened
from...
Select Case Item.Parent.Name
Case "Awaiting Approval", "Closed", "Open", "Researching",
"Commission Payment Issues"
myControls("MultiPage1").Item(1).visible = True
Case Else
myControls("MultiPage1").Item(1).visible = False
End Select
'*****************************************
Many thanks
Boris

"Sue Mosher [MVP-Outlook]" wrote:

> So you're opening an existing item and want to know what folder that item resides in? In that case, use the item's Parent property.
>
> --
> 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
>
> "BOR155" <BOR155@discussions.microsoft.com> wrote in message news:A40DA282-32E6-494D-9BEC-3BED246BE0F6@microsoft.com...
> > Sue
> > I am referring to the folder where the item being opened is stored...
> >
> >
> >
> > "Sue Mosher [MVP-Outlook]" wrote:
> >
> >> I wonder if you're a little confused about the difference between forms and items. A form is a UI/code template. An item is a data record. How an item displays in its own window depends on the form associated with that item.
> >>
> >> So, with that background, what is it that you're trying to find out when you refer to "the folder from which the form is opened"? Two choices:
> >>
> >> 1) the folder that the user currently looking at when they create a new item using a custom form
> >>
> >> 2) the folder where the item being opened is stored
>
> >> "BOR155" <BOR155@discussions.microsoft.com> wrote in message news:8417CA37-F30E-4BCA-B6D4-BB8ED5C23046@microsoft.com...
> >> >I want to have a block of code inside an Outlook form that will check whether
> >> > the folder from which the form is opened is "Sent Items" and if it is run
> >> > some code, and if not, run some other code.
> >> > Could someone pls tell me how to do this?
> >> > Regards
> >> > BORIS
> >>
>
Previous Topic:NEED MORE FIELDS TO SHOW IN ADDRESSBOOK
Next Topic:Outlook form: Action Names in Action tab has been deleted after user preview the form
Goto Forum: