Custom Form + Outlook Folder

Custom Form + Outlook Folder

Post by Qk9SMTU » Wed, 14 Jun 2006 18:06:01


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
 
 
 

Custom Form + Outlook Folder

Post by Sue Mosher » Wed, 14 Jun 2006 21:53:29

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.yqcomputer.com/
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.yqcomputer.com/

 
 
 

Custom Form + Outlook Folder

Post by Qk9SMTU » Thu, 15 Jun 2006 09:11:02

Sue
I am referring to the folder where the item being opened is stored...
 
 
 

Custom Form + Outlook Folder

Post by Sue Mosher » Thu, 15 Jun 2006 22:02:58

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.yqcomputer.com/
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.yqcomputer.com/
 
 
 

Custom Form + Outlook Folder

Post by Qk9SMTU » Fri, 16 Jun 2006 15:55:01

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