M
Marcin
I try to create Outlook 2003 add-in. I do not have much knowledge about this,
but thanks to great MSDN's article:
http://msdn.microsoft.com/office/un...ibrary/en-us/dv_vstechart/html/ol03csharp.asp
I think I will be able to manage it.
My problem concern AdvancedSearch function. I don't know how to create in C#
function that will be called when AdvancedSearch is finished and return
results. I tried something like this:
(...)
public void OnConnection(object application, Extensibility.ext_ConnectMode
connectMode, object addInInst, ref System.Array custom)
{
applicationObject =
(Microsoft.Office.Interop.Outlook.Application)application;
(…)
}
public void OnStartupComplete(ref System.Array custom)
{
applicationObject.AdvancedSearch
("Inbox","urn:schemas:mailheader:subject='Test'",false,"MySearch");
}
private void applicationObject_AdvancedSearchCompleted(object s)
{
MessageBox.Show("Search stops");
}
(…)
but it does not work.
Probably, I should add something like:
applicationObject.AdvancedSearchComplete += new
System.EventHandler(applicationObject_AdvancedSearchComplete);
but in this particular case I have error:
“The name ‘applicationObject_AdvancedSearchComplete’ does not exist in the
class or namespace…â€
What should I add/change?
TIA,
Marcin
but thanks to great MSDN's article:
http://msdn.microsoft.com/office/un...ibrary/en-us/dv_vstechart/html/ol03csharp.asp
I think I will be able to manage it.
My problem concern AdvancedSearch function. I don't know how to create in C#
function that will be called when AdvancedSearch is finished and return
results. I tried something like this:
(...)
public void OnConnection(object application, Extensibility.ext_ConnectMode
connectMode, object addInInst, ref System.Array custom)
{
applicationObject =
(Microsoft.Office.Interop.Outlook.Application)application;
(…)
}
public void OnStartupComplete(ref System.Array custom)
{
applicationObject.AdvancedSearch
("Inbox","urn:schemas:mailheader:subject='Test'",false,"MySearch");
}
private void applicationObject_AdvancedSearchCompleted(object s)
{
MessageBox.Show("Search stops");
}
(…)
but it does not work.
Probably, I should add something like:
applicationObject.AdvancedSearchComplete += new
System.EventHandler(applicationObject_AdvancedSearchComplete);
but in this particular case I have error:
“The name ‘applicationObject_AdvancedSearchComplete’ does not exist in the
class or namespace…â€
What should I add/change?
TIA,
Marcin