PC Review


Reply
Thread Tools Rate Thread

"can't show a non modal form when modal form is displayed"

 
 
tomer
Guest
Posts: n/a
 
      12th Jan 2004

Hi,

As i understood there is some problems displaying modal dialogs from
outlook,
So my add in uses modeless dialog

while outlook propeties dialog was opened,my add in tried to display a
modeless dialog
and i get the following error:

"can't show a non modal form when modal form is displayed"

What can i do inorder to solve the problem? can i detect whenever a modal
form is opened?


Thanks in advance


 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      12th Jan 2004
There are problems when displaying an Inspector modally, I use modal
VB forms in my addins and also from Outlook property pages. It depends
on whether I want the form code to run before any other code that
follows the call to the form. You will have to provide more
information about what you are doing and how.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"tomer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> Hi,
>
> As i understood there is some problems displaying modal dialogs from
> outlook,
> So my add in uses modeless dialog
>
> while outlook propeties dialog was opened,my add in tried to display

a
> modeless dialog
> and i get the following error:
>
> "can't show a non modal form when modal form is displayed"
>
> What can i do inorder to solve the problem? can i detect whenever a

modal
> form is opened?
>
>
> Thanks in advance
>
>



 
Reply With Quote
 
tomer
Guest
Posts: n/a
 
      12th Jan 2004
Thanks ken.

Here is what I am doing:

When a new message arrived to the inbox ,I am moving it to a different
folder,than I display
a VB modeless form, from my add in ,without setting it's
'OwnerForm'(myForm.Show) ,waiting for user input.

it works fine until the VB Form was displayed while I was changing account
properties
(tool->accounts->properties)

I don't need to display Inspector modally.
as a matter of fact I prefer using Modal forms so i can wait for user input
before farther processing,but as I explained, I thought it make problems.


thanks in advance


"Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> There are problems when displaying an Inspector modally, I use modal
> VB forms in my addins and also from Outlook property pages. It depends
> on whether I want the form code to run before any other code that
> follows the call to the form. You will have to provide more
> information about what you are doing and how.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
> "tomer" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >
> > Hi,
> >
> > As i understood there is some problems displaying modal dialogs from
> > outlook,
> > So my add in uses modeless dialog
> >
> > while outlook propeties dialog was opened,my add in tried to display

> a
> > modeless dialog
> > and i get the following error:
> >
> > "can't show a non modal form when modal form is displayed"
> >
> > What can i do inorder to solve the problem? can i detect whenever a

> modal
> > form is opened?
> >
> >
> > Thanks in advance
> >
> >

>
>



 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      12th Jan 2004
Tools, Accounts? You are working in Outlook 2000 Internet only mode?

The only thing I can think of to suggest is to handle any error that
occurs and if there's an error then don't show your form.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"tomer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks ken.
>
> Here is what I am doing:
>
> When a new message arrived to the inbox ,I am moving it to a

different
> folder,than I display
> a VB modeless form, from my add in ,without setting it's
> 'OwnerForm'(myForm.Show) ,waiting for user input.
>
> it works fine until the VB Form was displayed while I was changing

account
> properties
> (tool->accounts->properties)
>
> I don't need to display Inspector modally.
> as a matter of fact I prefer using Modal forms so i can wait for

user input
> before farther processing,but as I explained, I thought it make

problems.
>
>
> thanks in advance



 
Reply With Quote
 
John Covert
Guest
Posts: n/a
 
      12th Jan 2004
Tomer,

I think maybe you could kick around the idea of trapping an error on
MyForm.Show and then looping to retry every, say, 10 seconds until it
works...

On Error Resume Next
MyForm.Show
If Err.Number <> 0 Then
mystarttimevar = Time
Do While True
myendtimevar = Time
if myendvartime - mystarttimevar > 10 then ' ten seconds has
passed
MyForm.Show
If Err.Number= 0 then ' THE FORM WAS DISPLAYED
Exit Do
End if
' START TEN SECOND COUNT ALL OVER AGAIN
mystarttimevar = Time
end if
Loop
End if

I think that's not how one computes the difference between two times.
Maybe you could toss a MsgBox in there if ten seconds elapses just to let
the user know something is happening that they can't see.

John




"tomer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks ken.
>
> Here is what I am doing:
>
> When a new message arrived to the inbox ,I am moving it to a different
> folder,than I display
> a VB modeless form, from my add in ,without setting it's
> 'OwnerForm'(myForm.Show) ,waiting for user input.
>
> it works fine until the VB Form was displayed while I was changing account
> properties
> (tool->accounts->properties)
>
> I don't need to display Inspector modally.
> as a matter of fact I prefer using Modal forms so i can wait for user

input
> before farther processing,but as I explained, I thought it make problems.
>
>
> thanks in advance
>
>
> "Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > There are problems when displaying an Inspector modally, I use modal
> > VB forms in my addins and also from Outlook property pages. It depends
> > on whether I want the form code to run before any other code that
> > follows the call to the form. You will have to provide more
> > information about what you are doing and how.
> >
> > --
> > Ken Slovak
> > [MVP - Outlook]
> > http://www.slovaktech.com
> > Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
> > Reminder Manager, Extended Reminders, Attachment Options
> > http://www.slovaktech.com/products.htm
> >
> >
> > "tomer" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > >
> > > Hi,
> > >
> > > As i understood there is some problems displaying modal dialogs from
> > > outlook,
> > > So my add in uses modeless dialog
> > >
> > > while outlook propeties dialog was opened,my add in tried to display

> > a
> > > modeless dialog
> > > and i get the following error:
> > >
> > > "can't show a non modal form when modal form is displayed"
> > >
> > > What can i do inorder to solve the problem? can i detect whenever a

> > modal
> > > form is opened?
> > >
> > >
> > > Thanks in advance
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
tomer
Guest
Posts: n/a
 
      13th Jan 2004
Thanks john and ken,
What about using MODAL VB Form,will this work for me?

Thanks in advance.

"Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Tools, Accounts? You are working in Outlook 2000 Internet only mode?
>
> The only thing I can think of to suggest is to handle any error that
> occurs and if there's an error then don't show your form.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
> "tomer" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Thanks ken.
> >
> > Here is what I am doing:
> >
> > When a new message arrived to the inbox ,I am moving it to a

> different
> > folder,than I display
> > a VB modeless form, from my add in ,without setting it's
> > 'OwnerForm'(myForm.Show) ,waiting for user input.
> >
> > it works fine until the VB Form was displayed while I was changing

> account
> > properties
> > (tool->accounts->properties)
> >
> > I don't need to display Inspector modally.
> > as a matter of fact I prefer using Modal forms so i can wait for

> user input
> > before farther processing,but as I explained, I thought it make

> problems.
> >
> >
> > thanks in advance

>
>



 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      13th Jan 2004
A modal form also cannot be displayed when another modal form is being
displayed by the same process. Since Outlook COM addins run in-process
with Outlook the situation would be the same except if the custom form
was displayed the Outlook property sheet couldn't be displayed by the
user, they would get an error.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"tomer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks john and ken,
> What about using MODAL VB Form,will this work for me?
>
> Thanks in advance.



 
Reply With Quote
 
tomer
Guest
Posts: n/a
 
      13th Jan 2004
Thanks ken,you helped me a lot.
What about CBT_Hook ? do you think it can help me?
I will hook into the process of the window creation and will not display my
form as long as there are windows still opened
(either modal like option,or modeless like inpsectors) in outlook process.


Thanks again.

Btw:i tried to display my form as MODAL,it did not raise any exception,but
since i didnot set it's parent(i will do it soon)
the form was behind outlook.


"Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> A modal form also cannot be displayed when another modal form is being
> displayed by the same process. Since Outlook COM addins run in-process
> with Outlook the situation would be the same except if the custom form
> was displayed the Outlook property sheet couldn't be displayed by the
> user, they would get an error.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
> "tomer" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Thanks john and ken,
> > What about using MODAL VB Form,will this work for me?
> >
> > Thanks in advance.

>
>



 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      13th Jan 2004
I'm not familiar with CBT_Hook.

You can control how the form is displayed by setting its ZOrder.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"tomer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks ken,you helped me a lot.
> What about CBT_Hook ? do you think it can help me?
> I will hook into the process of the window creation and will not

display my
> form as long as there are windows still opened
> (either modal like option,or modeless like inpsectors) in outlook

process.
>
>
> Thanks again.
>
> Btw:i tried to display my form as MODAL,it did not raise any

exception,but
> since i didnot set it's parent(i will do it soon)
> the form was behind outlook.
>
>
> "Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > A modal form also cannot be displayed when another modal form is

being
> > displayed by the same process. Since Outlook COM addins run

in-process
> > with Outlook the situation would be the same except if the custom

form
> > was displayed the Outlook property sheet couldn't be displayed by

the
> > user, they would get an error.
> >
> > --
> > Ken Slovak
> > [MVP - Outlook]
> > http://www.slovaktech.com
> > Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
> > Reminder Manager, Extended Reminders, Attachment Options
> > http://www.slovaktech.com/products.htm
> >
> >
> > "tomer" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Thanks john and ken,
> > > What about using MODAL VB Form,will this work for me?
> > >
> > > Thanks in advance.

> >
> >

>
>



 
Reply With Quote
 
New Member
Join Date: Dec 2007
Posts: 3
 
      26th Feb 2008
Hi All,

I'm developing COM Add-in for Outlook using Visual Basic 6.0.

I'm able to see my form while the editor is normal. If the editor is word then I'm unable to see my VB forms on the same word email editor, instead of its appearing on the outlook explorer.

I'm struggling how to retain the same behavior as for Normal Editor.

Your prompt reply would be appreciated.

Thanks & Regards
Ashokkumar P
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Form that is not a top-level form cannot be displayed as a modal dialog box error =?Utf-8?B?S2VycnkgTW9vcm1hbg==?= Microsoft VB .NET 4 14th Mar 2007 03:47 PM
Form that is already displayed modally cannot be displayed as a modal dialog box. Close the form before calling showDialog. Jared Microsoft Dot NET Framework Forms 4 28th Sep 2006 09:49 AM
Re-Post - DoCmd.OpenForm Modality Problem - Form's Modal = "Yes" =?Utf-8?B?R2FyeVo=?= Microsoft Access Macros 3 29th Nov 2004 02:23 PM
Report Preview with calling form Pop Up & Modal "Yes" fred Microsoft Access Reports 0 10th Jun 2004 04:45 PM
Open modal web form.... or "simirly" to modal :) What (and how) possible to do? Sukhanov Volodya Microsoft VB .NET 4 3rd Nov 2003 02:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:59 AM.