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

Tags: , , ,

Strange problem in outlook 2007





 
 
Thread Tools Display Modes
  #1  
Old November 20th 06, 01:35 PM posted to microsoft.public.outlook.program_forms
eranhef@gmail.com
external usenet poster
 
Posts: 12
Default Strange problem in outlook 2007

Hi all,
i have created an outlook 2007 VSTO add-in.
In the add-in i'm creating a new calendar folder with 2 events:
1) Folder.BeforeItemMove event
2) Foldr.Items.ItemAdd event

the code is:
_sstFolder.BeforeItemMove += new

Microsoft.Office.Interop.Outlook.MAPIFolderEvents_ 12_BeforeItemMoveEventHandler(FolderBeforeItemMove );
_sstFolder.Items.ItemAdd += new

Microsoft.Office.Interop.Outlook.ItemsEvents_ItemA ddEventHandler(Items_ItemAdd);

_sstFolder is Outlook.Folder and not Outlook.MapiFolder.

also i have a custom task pane in my add-in.

The Problem:
When i'm pressing the custom task pane, the 2 event of the folder is
disappearing!!
So, after i'm pressing the custom task pane i cannot create a new
appointment or delete an appointment.

Can anyone help me??

Tnx, Eran Hefer.

Ads
  #2  
Old November 20th 06, 04:55 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,793
Default Strange problem in outlook 2007

What do you mean by "pressing the task pane"?

How are you adding the task pane? Are you using the VSTO CustomTaskPanes
collection?

Where are your event handlers? Are they in a class with global scope
throughout the addin, such as in ThisAddin? Make sure they aren't being
garbage collected. What about the Folder reference, could it be garbage
collected while you still need the reference? Is it declared at class level
in a class like ThisAddin that remains in scope?

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


wrote in message
ups.com...
Hi all,
i have created an outlook 2007 VSTO add-in.
In the add-in i'm creating a new calendar folder with 2 events:
1) Folder.BeforeItemMove event
2) Foldr.Items.ItemAdd event

the code is:
_sstFolder.BeforeItemMove += new

Microsoft.Office.Interop.Outlook.MAPIFolderEvents_ 12_BeforeItemMoveEventHandler(FolderBeforeItemMove );
_sstFolder.Items.ItemAdd += new

Microsoft.Office.Interop.Outlook.ItemsEvents_ItemA ddEventHandler(Items_ItemAdd);

_sstFolder is Outlook.Folder and not Outlook.MapiFolder.

also i have a custom task pane in my add-in.

The Problem:
When i'm pressing the custom task pane, the 2 event of the folder is
disappearing!!
So, after i'm pressing the custom task pane i cannot create a new
appointment or delete an appointment.

Can anyone help me??

Tnx, Eran Hefer.


  #3  
Old November 21st 06, 06:57 AM posted to microsoft.public.outlook.program_forms
eranhef@gmail.com
external usenet poster
 
Posts: 12
Default Strange problem in outlook 2007

Hi Ken,
First of all - Tnx for your help!!
I've declared the Folder events (notice that the folder is
Outlook.Folder and not Outlook.MAPIFolder) in the ThisAddin class,
within the FolderSwitch event in the current active explorer. the
active explorer is kept as a global variable in the addin and never
nullified.

I'm creating the custom task pane (as a user control) using the VSTO
CustomTaskPanes collection.
When i'm pressing a DropDownList on my CustomTaskPane, the events of my
folder are both dead.
It seems that thay have been garbage collected, but i dont know why.
All the code (beside the User Control) is handled within the ThisAddin
class.



Ken Slovak - [MVP - Outlook] wrote:
What do you mean by "pressing the task pane"?

How are you adding the task pane? Are you using the VSTO CustomTaskPanes
collection?

Where are your event handlers? Are they in a class with global scope
throughout the addin, such as in ThisAddin? Make sure they aren't being
garbage collected. What about the Folder reference, could it be garbage
collected while you still need the reference? Is it declared at class level
in a class like ThisAddin that remains in scope?

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


wrote in message
ups.com...
Hi all,
i have created an outlook 2007 VSTO add-in.
In the add-in i'm creating a new calendar folder with 2 events:
1) Folder.BeforeItemMove event
2) Foldr.Items.ItemAdd event

the code is:
_sstFolder.BeforeItemMove += new

Microsoft.Office.Interop.Outlook.MAPIFolderEvents_ 12_BeforeItemMoveEventHandler(FolderBeforeItemMove );
_sstFolder.Items.ItemAdd += new

Microsoft.Office.Interop.Outlook.ItemsEvents_ItemA ddEventHandler(Items_ItemAdd);

_sstFolder is Outlook.Folder and not Outlook.MapiFolder.

also i have a custom task pane in my add-in.

The Problem:
When i'm pressing the custom task pane, the 2 event of the folder is
disappearing!!
So, after i'm pressing the custom task pane i cannot create a new
appointment or delete an appointment.

Can anyone help me??

Tnx, Eran Hefer.


  #4  
Old November 21st 06, 03:17 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,793
Default Strange problem in outlook 2007

So after you access the task pane the Folder events never fire again, or do
they fail to fire only when the task pane has focus?

I usually do something like this:

public partial class ThisAddin
{
private Outlook.Folder _Folder = null;

// blah, blah, more declarations and code
}

Not only the Explorer but also the Folder must be declared at class level,
otherwise the Folder may go out of scope. For example declaring the Folder
object inside FolderSwitch would let Folder go out of scope when that
procedure ends.

I can't say specifically about the CustomTaskPanes collection doing
anything, I've been avoiding that collection mostly since I discovered that
you can't set a Window for it. I've been using the Office.CustomTaskPane
objects so I can set what Window (Inspector or Explorer) I want the task
pane to be shown in.

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


wrote in message
oups.com...
Hi Ken,
First of all - Tnx for your help!!
I've declared the Folder events (notice that the folder is
Outlook.Folder and not Outlook.MAPIFolder) in the ThisAddin class,
within the FolderSwitch event in the current active explorer. the
active explorer is kept as a global variable in the addin and never
nullified.

I'm creating the custom task pane (as a user control) using the VSTO
CustomTaskPanes collection.
When i'm pressing a DropDownList on my CustomTaskPane, the events of my
folder are both dead.
It seems that thay have been garbage collected, but i dont know why.
All the code (beside the User Control) is handled within the ThisAddin
class.


 




Thread Tools
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 Status Bar message in Outlook 2007 timjstone Outlook - Installation 0 November 16th 06 10:49 AM
Very strange problem with Outlook folders mgaines Outlook - General Queries 3 November 16th 06 06:59 AM
a strange problem marrie Outlook Express 3 April 27th 06 05:15 AM
Strange Outlook Problem when sending HTML Mail Feezie Outlook - General Queries 0 February 15th 06 05:55 PM
Strange Outlook Attachment Problem....Please help... Jim Smith Outlook - General Queries 3 February 10th 06 01:31 PM


All times are GMT +1. The time now is 04:20 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2008 Outlook Banter, part of the NewsgroupBanter project.
The comments are property of their posters.
Web Advertising - Facebook proxy list - Buy Out Cell Phone Contract - Web Advertising - Online Advertising