G
george wen
Hi All,
I wrote a outlook com addin which will popup a dialogue box when user click
on 'replyall' button to confirm whether they do want to reply to all.
However, after using it for a while, we noticed one bug:
If you open a saved .msg file and close it then you won't be able to open it
for a second time.
I did a bit search and found the following discussion:
http://www.devnewsgroups.net/group/microsoft.public.office.developer.outlook.vba/topic61948.aspx
However, the same fix doesn't work for me...
my code for newinspector method:
void inspectors_NewInspector(Outlook.Inspector Inspector)
{
object test = Inspector.CurrentItem;
System.Runtime.InteropServices.Marshal.ReleaseComObject(test);
GC.WaitForPendingFinalizers();
//while (test!=null)
//{
// if
(System.Runtime.InteropServices.Marshal.ReleaseComObject(test) == 0)
// break;
//}
// Check to see if this is a new window we don't already track
OutlookInspector existingWindow =
FindOutlookInspector(Inspector);
if (existingWindow == null)
{
AddInspector(Inspector);
}
}
I even tried to add the garage clean code to the following method:
void WrappedInspectorWindow_Close(object sender, EventArgs e)
{
OutlookInspector window = (OutlookInspector)sender;
object test =
((Outlook.Inspector)window).CurrentItem;//Inspector.CurrentItem;
window.Close -= new EventHandler(WrappedInspectorWindow_Close);
inspectorWindows.Remove(window);
System.Runtime.InteropServices.Marshal.ReleaseComObject(test);
GC.WaitForPendingFinalizers();
while (test != null)
{
if
(System.Runtime.InteropServices.Marshal.ReleaseComObject(test) == 0)
break;
}
}
I am strething my hair out at the moment, if anyone can provide any help it
will be definitely much appreciated!
George Wen
Senior DBA & Application Specialist
I wrote a outlook com addin which will popup a dialogue box when user click
on 'replyall' button to confirm whether they do want to reply to all.
However, after using it for a while, we noticed one bug:
If you open a saved .msg file and close it then you won't be able to open it
for a second time.
I did a bit search and found the following discussion:
http://www.devnewsgroups.net/group/microsoft.public.office.developer.outlook.vba/topic61948.aspx
However, the same fix doesn't work for me...
my code for newinspector method:
void inspectors_NewInspector(Outlook.Inspector Inspector)
{
object test = Inspector.CurrentItem;
System.Runtime.InteropServices.Marshal.ReleaseComObject(test);
GC.WaitForPendingFinalizers();
//while (test!=null)
//{
// if
(System.Runtime.InteropServices.Marshal.ReleaseComObject(test) == 0)
// break;
//}
// Check to see if this is a new window we don't already track
OutlookInspector existingWindow =
FindOutlookInspector(Inspector);
if (existingWindow == null)
{
AddInspector(Inspector);
}
}
I even tried to add the garage clean code to the following method:
void WrappedInspectorWindow_Close(object sender, EventArgs e)
{
OutlookInspector window = (OutlookInspector)sender;
object test =
((Outlook.Inspector)window).CurrentItem;//Inspector.CurrentItem;
window.Close -= new EventHandler(WrappedInspectorWindow_Close);
inspectorWindows.Remove(window);
System.Runtime.InteropServices.Marshal.ReleaseComObject(test);
GC.WaitForPendingFinalizers();
while (test != null)
{
if
(System.Runtime.InteropServices.Marshal.ReleaseComObject(test) == 0)
break;
}
}
I am strething my hair out at the moment, if anyone can provide any help it
will be definitely much appreciated!
George Wen
Senior DBA & Application Specialist