Welcome to Lockergnome.com!
HomeHome FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

New Explorer Window not resizing

 
   Home -> Office -> Program Add-Ins RSS
Next:  Program Add-Ins: Programmatically changing the message's sender field in MA..  
Author Message
hazyblur

External


Since: Aug 07, 2007
Posts: 1



(Msg. 1) Posted: Tue Aug 07, 2007 7:17 am
Post subject: New Explorer Window not resizing
Archived from groups: microsoft>public>outlook>program_addins (more info?)

I am building a C# Outlook add-in. When a new explorer window is
launched I subscribe to the event and resize the window. However, the
window refuses to resize and remains the same size as it was launched
initially. The initial size is the same as the initial explorer size
when outlook is opened for the first time.

Is there a way to resize the explorer windows appropriately? I am not
facing a problem with inspector windows.

I am ensuring that before resizing is done the Window state is set to
olNormalized and is not in the Maximized or Minimized state.

I am pasting snippet of my code here

Outlook.Explorers _exp;
Outlook.Inspectors _ins;

private void ThisApplication_Startup(object sender, System.EventArgs
e)
{
if (this.ActiveExplorer().WindowState ==
Microsoft.Office.Interop.Outlook.OlWindowState.olMaximized)
{

this.ActiveExplorer().WindowState =
Microsoft.Office.Interop.Outlook.OlWindowState.olNormalWindow;
}

_exp = this.Explorers;
_ins = this.Inspectors;


_exp.NewExplorer +=new
Microsoft.Office.Interop.Outlook.ExplorersEvents_NewExplorerEventHandler(_exp_NewExplorer);
_ins.NewInspector += new
Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler(_ins_NewInspector);



}

void _exp_NewExplorer(Microsoft.Office.Interop.Outlook.Explorer
Explorer)
{

Explorer.Width = 400;
Explorer.Height = 400;
Explorer.Top = 50;
Explorer.Left = 50;

}


Please help.
Back to top
Login to vote
Ken Slovak - [MVP - Outlo

External


Since: Oct 17, 2003
Posts: 3213



(Msg. 2) Posted: Tue Aug 07, 2007 11:01 am
Post subject: Re: New Explorer Window not resizing [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

NewExplorer isn't firing in this case because the Explorer is already there
when you subscribe to the NewExplorer event. That's obvious because you've
already accessed ActiveExplorer. Do your initial resizing in
ThisApplication_Startup.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


<hazyblur.DeleteThis@gmail.com> wrote in message
news:1186496261.057833.252250@k79g2000hse.googlegroups.com...
>I am building a C# Outlook add-in. When a new explorer window is
> launched I subscribe to the event and resize the window. However, the
> window refuses to resize and remains the same size as it was launched
> initially. The initial size is the same as the initial explorer size
> when outlook is opened for the first time.
>
> Is there a way to resize the explorer windows appropriately? I am not
> facing a problem with inspector windows.
>
> I am ensuring that before resizing is done the Window state is set to
> olNormalized and is not in the Maximized or Minimized state.
>
> I am pasting snippet of my code here
>
> Outlook.Explorers _exp;
> Outlook.Inspectors _ins;
>
> private void ThisApplication_Startup(object sender, System.EventArgs
> e)
> {
> if (this.ActiveExplorer().WindowState ==
> Microsoft.Office.Interop.Outlook.OlWindowState.olMaximized)
> {
>
> this.ActiveExplorer().WindowState =
> Microsoft.Office.Interop.Outlook.OlWindowState.olNormalWindow;
> }
>
> _exp = this.Explorers;
> _ins = this.Inspectors;
>
>
> _exp.NewExplorer +=new
> Microsoft.Office.Interop.Outlook.ExplorersEvents_NewExplorerEventHandler(_exp_NewExplorer);
> _ins.NewInspector += new
> Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler(_ins_NewInspector);
>
>
>
> }
>
> void _exp_NewExplorer(Microsoft.Office.Interop.Outlook.Explorer
> Explorer)
> {
>
> Explorer.Width = 400;
> Explorer.Height = 400;
> Explorer.Top = 50;
> Explorer.Left = 50;
>
> }
>
>
> Please help.
>
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> Program Add-Ins All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 General
 Microsoft Windows XP
 Microsoft Windows Vista
 Microsoft Windows (other)
  Microsoft Office
 Microsoft Office (other)
 Computer Security
 Linux
 Movies


[ Contact us | Terms of Service/Privacy Policy ]