Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / August 2006

Tip: Looking for answers? Try searching our database.

Item_Open Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Culverin - 29 Aug 2006 16:27 GMT
Hi:

Is there a way to tell programatically in the Item_Open Function whether a
form is being opened in design mode or run mode?

I have code in the Item_Open Function that will hide pages and show an error
page for user messages and actions if the logic detects that the version of
the user's form being opened is different from the current version.

The problem is that the Item_Open code executes whether the form is opened
in design or run time.  I only want this part of the Item_Open code to
execute at run time.  Is this possible?

Thanks for your help.
Sue Mosher [MVP-Outlook] - 29 Aug 2006 16:42 GMT
You can hold down the Shift key to prevent the form from running code when opening it in design mode.

Signature

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
 

> Hi:
>
[quoted text clipped - 10 lines]
>
> Thanks for your help.
Culverin - 29 Aug 2006 17:29 GMT
Thanks.  Yes, that works.  However, when I do that I now have two Calendar
controls and a List View control that shrink of their own volition.  I've not
been able to figure out why these controls do that.  Any ideas?

If there isn't a method or property to determine whether a form is opened in
design or run time I'll have to code a run-time error and use the Err code to
execute the Item_Open code I want to run conditionally.  I know this is ugly,
but it'll work.

Thanks.

> You can hold down the Shift key to prevent the form from running code when opening it in design mode.
>
[quoted text clipped - 12 lines]
> >
> > Thanks for your help.
Sue Mosher [MVP-Outlook] - 29 Aug 2006 18:10 GMT
You can probably check by using CommandBars, since certain commands are visible and enabled in form design mode that shouldn't otherwise be available.

I generally avoid using any controls on forms that don't come with Outlook itself. You might have to include code to set those controls' UI properties.

Signature

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
 

> Thanks.  Yes, that works.  However, when I do that I now have two Calendar
> controls and a List View control that shrink of their own volition.  I've not
[quoted text clipped - 23 lines]
>> >
>> > Thanks for your help.
Culverin - 29 Aug 2006 19:21 GMT
Good idea about the CommandBars.

I have code to set the UI properties; which is why I need it to run in
design mode in the Item_Open but not the version check code.

Thanks a bunch.

> You can probably check by using CommandBars, since certain commands are visible and enabled in form design mode that shouldn't otherwise be available.
>
[quoted text clipped - 27 lines]
> >> >
> >> > Thanks for your help.
Culverin - 30 Aug 2006 14:00 GMT
The "Form Design" bar is not visible at run time.  I tried to use the visible
property of the object in the Item_Open function to determine whether the
form is opening in design or run time.  It didn't work because the visible
property is still false when the Item_Open is executing.  Similarly, the
Layout menu is not visible at run time.  I tried using the Controls.Count
property as well but both design and run time counts were 9.  I can only
conclude from this that the initial properties of the CommandBars are set
after the Item_Open executes.

When do these CommandBar changes occur?  Obviously, the form knows it's
being opened in design mode and sets certain properties differently than at
run time.  What executes after Item_Open and is it accessible
programatically?  Alternatively, is there a property that can be referenced
in the Item_Open function that will allow me to tell the difference between
design and run?

Thanks.

> You can probably check by using CommandBars, since certain commands are visible and enabled in form design mode that shouldn't otherwise be available.
>
[quoted text clipped - 27 lines]
> >> >
> >> > Thanks for your help.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.