Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Developer Outlook Addins > Problem with mi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 1645 of 1746
Post > Topic >>

Problem with minimized Outlook

by "Sergio Giacomini" <sgiacomini@[EMAIL PROTECTED] > Jan 2, 2008 at 05:38 PM

This is a multi-part message in MIME format.

------=_NextPart_000_000C_01C84D66.5AFB22F0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

I'm executing this example, but when I execute Outlook minimized, the =
application doesn't work.
Somebody have idea that is happening?

Thanks!

Sergio


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Outlook =3D Microsoft.Office.Interop.Outlook;
using Office =3D Microsoft.Office.Core;
using System.Windows.Forms;

namespace OutlookAddIn
{
    public partial class ThisAddIn
    {
      Office.CommandBar fooAddInToolBar;
      Outlook.Explorers selectExplorers;

      private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
          selectExplorers =3D this.Application.Explorers;
          selectExplorers.NewExplorer +=3D new =
Outlook.ExplorersEvents_NewExplorerEventHandler(newExplorer_Event);
          AddToolbar();
        }
      private void newExplorer_Event(Outlook.Explorer new_Explorer)
      {
        ((Outlook._Explorer)new_Explorer).Activate();
        fooAddInToolBar =3D null;
        AddToolbar();
      }

      private void AddToolbar()
      {
        try
        {
          if (fooAddInToolBar =3D=3D null)
          {
            Office.CommandBars cmdBars =3D =
this.Application.ActiveExplorer().CommandBars;
            fooAddInToolBar =3D cmdBars.Add("fooAddInToolBarName", =
Office.MsoBarPosition.msoBarTop, false, true);
            fooAddInToolBar.Visible =3D true;
          }
        }
        catch (Exception Ex)
        {=20
          MessageBox.Show("Error: " + Ex.Message.ToString());
        }
      }


      private void ButtonClick(Office.CommandBarButton ctrl, ref bool =
cancel)
      {
        MessageBox.Show("You clicked: " + ctrl.Caption);
      }

        private void ThisAddIn_Shutdown(object sender, System.EventArgs =
e)
        {
        }

        #region VSTO generated code

        /// <summary>
        /// Required method for Designer sup****t - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InternalStartup()
        {
            this.Startup +=3D new =
System.EventHandler(ThisAddIn_Startup);
            this.Shutdown +=3D new =
System.EventHandler(ThisAddIn_Shutdown);
        }
       =20
        #endregion
    }
}

------=_NextPart_000_000C_01C84D66.5AFB22F0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16587" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I'm executing this example, but when I =
execute=20
Outlook minimized, the application doesn't work.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Somebody have idea that is =
happening?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Sergio</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D1>using System;<BR>using=20
System.Collections.Generic;<BR>using System.Linq;<BR>using =
System.Text;<BR>using=20
System.Xml.Linq;<BR>using Outlook =3D =
Microsoft.Office.Interop.Outlook;<BR>using=20
Office =3D Microsoft.Office.Core;<BR>using =
System.Windows.Forms;</FONT></DIV>
<DIV><FONT face=3DArial size=3D1></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D1>namespace =
OutlookAddIn<BR>{<BR>&nbsp;&nbsp;&nbsp;=20
public partial class ThisAddIn<BR>&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Office.CommandBar=20
fooAddInToolBar;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Outlook.Explorers=20
selectExplorers;</FONT></DIV>
<DIV><FONT face=3DArial size=3D1></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private =
void=20
ThisAddIn_Startup(object sender, System.EventArgs=20
e)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
selectExplorers =3D=20
this.Application.Explorers;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
selectExplorers.NewExplorer +=3D new=20
Outlook.ExplorersEvents_NewExplorerEventHandler(newExplorer_Event);<BR>&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
AddToolbar();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private void=20
newExplorer_Event(Outlook.Explorer=20
new_Explorer)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
((Outlook._Explorer)new_Explorer).Activate();<BR>&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;=20
fooAddInToolBar =3D null;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
AddToolbar();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face=3DArial size=3D1></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private =
void=20
AddToolbar()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if =
(fooAddInToolBar=20
=3D=3D null)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Office.CommandBars cmdBars =3D=20
this.Application.ActiveExplorer().CommandBars;<BR>&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
fooAddInToolBar =3D cmdBars.Add("fooAddInToolBarName",=20
Office.MsoBarPosition.msoBarTop, false,=20
true);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;=20
fooAddInToolBar.Visible =3D=20
true;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch (Exception=20
Ex)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
MessageBox.Show("Error: " +=20
Ex.Message.ToString());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face=3DArial size=3D1></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT><BR><FONT face=3DArial=20
size=3D1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private void=20
ButtonClick(Office.CommandBarButton ctrl, ref bool=20
cancel)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MessageBox.Show("You =
clicked: "=20
+ ctrl.Caption);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face=3DArial size=3D1></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private=20
void ThisAddIn_Shutdown(object sender, System.EventArgs=20
e)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT face=3DArial size=3D1></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region=20
VSTO generated code</FONT></DIV>
<DIV><FONT face=3DArial size=3D1></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ///=20
&lt;summary&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// =
Required=20
method for Designer sup****t - do not=20
modify<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// the contents of =
this=20
method with the code =
editor.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ///=20
&lt;/summary&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private =
void=20
InternalStartup()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
this.Startup +=3D new=20
System.EventHandler(ThisAddIn_Startup);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
this.Shutdown +=3D new=20
System.EventHandler(ThisAddIn_Shutdown);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
#endregion<BR>&nbsp;&nbsp;&nbsp;=20
}<BR>}<BR></FONT></DIV></BODY></HTML>

------=_NextPart_000_000C_01C84D66.5AFB22F0--
 




 3 Posts in Topic:
Problem with minimized Outlook
"Sergio Giacomini&qu  2008-01-02 17:38:58 
Re: Problem with minimized Outlook
"Ken Slovak - [MVP -  2008-01-02 15:09:42 
Re: Problem with minimized Outlook
"Sergio Giacomini&qu  2008-01-02 18:40:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 15:50:27 CST 2008.