A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

UserForm ShowModal strange behaviour



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 9th 06, 04:39 PM posted to microsoft.public.outlook.program_forms
David OShea
external usenet poster
 
Posts: 6
Default UserForm ShowModal strange behaviour

I am trying to create a splash screen for Outlook which basically asks the end user if
they agree to the Email Security Policy or Not. Its a VBA UserForm that is set to show on
Application_Startup.
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub Application_Startup()
UserForm1.Show
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ShowModal property of the form is set to True. This works fine on Outlook 2000. The
end user cannot proceed to do anything with the Outlook Application until they click the
"I Agree" button on the splach screen. If they choose not to agree then the splash screen
quits out of the application.

On Outlook 2003 the ShowModal property of the form seems to be implemented very
differently. The splash opens up no problem, but the ShowModal = True seems to only apply
to the Tool bar and Menu Bar buttons. The Close X button on the top right of the Outlook
Application is active and when clicked it closes the splash screen. Browsing the Explorer
folders and opening emails is also possible plus when the email is open Tool Bar and Menu
Bar buttons also become active on that email. All this while the "Modal ??? Form" stays on
top of the Application.

When I run the project from within VB environment it works very well. In true Modal
Fashion. The behaviour described above only happens when the application is starting up.

To me this seems like one hell of a BUG..! Or, should I say Design Feature of OL 2003 or
am I missing something?

Has anyone come accross this before. Any idea how to get around it? Any help is greatly
appricated.

Rgds
Dave O'Shea


Ads
  #2  
Old March 14th 06, 05:58 PM posted to microsoft.public.outlook.program_forms
David OShea
external usenet poster
 
Posts: 6
Default UserForm ShowModal strange behaviour

Looks like it's a bit of a bug in MSForms 2.0.
Instead I used Win API to get the handle of the form an set to the front, which as a
matter of fact makes it modal.

Private Declare Function SetForegroundWindow Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Sub UserForm_Initialize()
Dim hWnd As Long
hWnd = FindWindow("ThunderDFrame", Me.Caption)
SetForegroundWindow hWnd
End Sub

"David OShea" wrote in message
...
I am trying to create a splash screen for Outlook which basically asks the end user if
they agree to the Email Security Policy or Not. Its a VBA UserForm that is set to show on
Application_Startup.
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub Application_Startup()
UserForm1.Show
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ShowModal property of the form is set to True. This works fine on Outlook 2000. The
end user cannot proceed to do anything with the Outlook Application until they click the
"I Agree" button on the splach screen. If they choose not to agree then the splash
screen quits out of the application.

On Outlook 2003 the ShowModal property of the form seems to be implemented very
differently. The splash opens up no problem, but the ShowModal = True seems to only
apply to the Tool bar and Menu Bar buttons. The Close X button on the top right of the
Outlook Application is active and when clicked it closes the splash screen. Browsing the
Explorer folders and opening emails is also possible plus when the email is open Tool
Bar and Menu Bar buttons also become active on that email. All this while the "Modal ???
Form" stays on top of the Application.

When I run the project from within VB environment it works very well. In true Modal
Fashion. The behaviour described above only happens when the application is starting up.

To me this seems like one hell of a BUG..! Or, should I say Design Feature of OL 2003 or
am I missing something?

Has anyone come accross this before. Any idea how to get around it? Any help is greatly
appricated.

Rgds
Dave O'Shea



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange copying of messages Auguri Outlook Express 13 February 10th 06 07:20 PM
strange encryption behavior Larry Outlook - General Queries 0 January 24th 06 09:26 PM
Strange Files Newsgroups Outlook - General Queries 0 January 22nd 06 02:12 PM
"Design This Form" strange behaviour and not displaying as it should James Cassidy Outlook - Using Forms 0 January 21st 06 03:01 PM
Collating sequence seems strange Jim K Outlook - Using Contacts 2 January 17th 06 08:44 PM


All times are GMT +1. The time now is 03:14 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.