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 and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

.NET AddIn Question UserControl in Folder homepage



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 1st 06, 12:59 PM posted to microsoft.public.outlook.program_vba
David Ing
external usenet poster
 
Posts: 7
Default .NET AddIn Question UserControl in Folder homepage

Hello,

I have a .NET winforms UserControl hosted inside a HTML page which is
referenced as a Outlook Folder Home Page. (Kind of like the recent MSFT CRM
Integration example)

The .NET UserControl is initialized by using the following bit of jscript in
the HTML:

var oApp = window.external.OutlookApplication;
SomeControl.Initialize(oApp);

So what I need some info around is this: How do I, from my .NET UserControl,
gain access back into my .NET Outlook Add-in instance?

Paraphrased, I need to be able to call .NET functions from my UserControl
(the one hosted in the HTML page) back into the Outlook-Addin.

In jscript, in the same HTML page, I can reference the Add-In using the
COMAddIns enumeration, i.e (roughly):

var addin = app.COMAddIns.Item("MyAddIn.Connect");
var h = addin.Object;
h.AdotNetFunctionInMyAddIn("hello")

But how would I do this from within my .NET UserControl in C#?

Any help, clues, ideas appreciated. Thanks!
David
  #2  
Old March 1st 06, 07:37 PM posted to microsoft.public.outlook.program_vba
Dave Kane [MVP - Outlook]
external usenet poster
 
Posts: 33
Default .NET AddIn Question UserControl in Folder homepage

I haven't tried this but I assume that you already tried the equivalent of
your in-page jscript and that didn't work. You can get to an add-in in the
running Outlook session from IE hosted in a FHP, but a standalone browser
has different security barriers. Perhaps your UserControl, even though it's
hosted in the FHP, is hitting those barriers. Do you need to reach the
add-in instance that Outlook loaded on startup, or just access Outlook data?


"David Ing" wrote in message
...
Hello,

I have a .NET winforms UserControl hosted inside a HTML page which is
referenced as a Outlook Folder Home Page. (Kind of like the recent MSFT
CRM
Integration example)

The .NET UserControl is initialized by using the following bit of jscript
in
the HTML:

var oApp = window.external.OutlookApplication;
SomeControl.Initialize(oApp);

So what I need some info around is this: How do I, from my .NET
UserControl,
gain access back into my .NET Outlook Add-in instance?

Paraphrased, I need to be able to call .NET functions from my UserControl
(the one hosted in the HTML page) back into the Outlook-Addin.

In jscript, in the same HTML page, I can reference the Add-In using the
COMAddIns enumeration, i.e (roughly):

var addin = app.COMAddIns.Item("MyAddIn.Connect");
var h = addin.Object;
h.AdotNetFunctionInMyAddIn("hello")

But how would I do this from within my .NET UserControl in C#?

Any help, clues, ideas appreciated. Thanks!
David



  #3  
Old March 1st 06, 08:46 PM posted to microsoft.public.outlook.program_vba
David Ing
external usenet poster
 
Posts: 7
Default .NET AddIn Question UserControl in Folder homepage

Thanks for the reply Dave.

I have tried the moral equivalent of the jscript in .NET, but it seems to
come down the following problems:

- When I get back the AddIns collection from within .NET, i.e. with this:

Dim o As Microsoft.Office.Core.COMAddIn
Dim addins As Microsoft.Office.Core.COMAddIns
addins = olapp.COMAddIns
o = addins.Item("TheRightProgId")

...then the COMAddIn.Item.Object is alway 'null'.

- I know that I can access the object because the jscript (the one that
actually launchs the .NET UserControl) works fine, i.e. can use the COMAddIn
..Object just fine.

Also, to be clear, I need info/funcitonality from my AddIn, not just general
Outlook info.

More Background, in case it's useful:

- This is a .NET 1.1 Shimmed Outlook Add-in written in C#
- Using Outlook 2003 (although I need it to work for more than just 2003,
which is why I didn't go the VSTO2005 route).
- If I write a stand-alone VB.NET app that get's a new _app, i.e. outside
the AddIn Outlook.ApplicationClass, then the COMAddIn.Object are always
'null' too, even though they 'run' and are shown '.Connected=true'

Any help, ideas etc most appreciated...

"Dave Kane [MVP - Outlook]" wrote:

I haven't tried this but I assume that you already tried the equivalent of
your in-page jscript and that didn't work. You can get to an add-in in the
running Outlook session from IE hosted in a FHP, but a standalone browser
has different security barriers. Perhaps your UserControl, even though it's
hosted in the FHP, is hitting those barriers. Do you need to reach the
add-in instance that Outlook loaded on startup, or just access Outlook data?


"David Ing" wrote in message
...
Hello,

I have a .NET winforms UserControl hosted inside a HTML page which is
referenced as a Outlook Folder Home Page. (Kind of like the recent MSFT
CRM
Integration example)

The .NET UserControl is initialized by using the following bit of jscript
in
the HTML:

var oApp = window.external.OutlookApplication;
SomeControl.Initialize(oApp);

So what I need some info around is this: How do I, from my .NET
UserControl,
gain access back into my .NET Outlook Add-in instance?

Paraphrased, I need to be able to call .NET functions from my UserControl
(the one hosted in the HTML page) back into the Outlook-Addin.

In jscript, in the same HTML page, I can reference the Add-In using the
COMAddIns enumeration, i.e (roughly):

var addin = app.COMAddIns.Item("MyAddIn.Connect");
var h = addin.Object;
h.AdotNetFunctionInMyAddIn("hello")

But how would I do this from within my .NET UserControl in C#?

Any help, clues, ideas appreciated. Thanks!
David




  #4  
Old March 1st 06, 09:00 PM posted to microsoft.public.outlook.program_vba
Dave Kane [MVP - Outlook]
external usenet poster
 
Posts: 33
Default .NET AddIn Question UserControl in Folder homepage

Have you tried passing the COMAddIn object from the jscript to the
UserControl (i.e. add another parameter to the Initialize method that
accepts the object)? Just a thought, you'll probably hit the same barrier
you're hitting now but maybe you'll get a useful exception. Also, at this
point
addins = olapp.COMAddIns
can you get a value for addins.Count? If not does it throw an exception? If
it does, can you iterate through the collection?

"David Ing" wrote in message
...
Thanks for the reply Dave.

I have tried the moral equivalent of the jscript in .NET, but it seems to
come down the following problems:

- When I get back the AddIns collection from within .NET, i.e. with this:

Dim o As Microsoft.Office.Core.COMAddIn
Dim addins As Microsoft.Office.Core.COMAddIns
addins = olapp.COMAddIns
o = addins.Item("TheRightProgId")

..then the COMAddIn.Item.Object is alway 'null'.

- I know that I can access the object because the jscript (the one that
actually launchs the .NET UserControl) works fine, i.e. can use the
COMAddIn
.Object just fine.

Also, to be clear, I need info/funcitonality from my AddIn, not just
general
Outlook info.

More Background, in case it's useful:

- This is a .NET 1.1 Shimmed Outlook Add-in written in C#
- Using Outlook 2003 (although I need it to work for more than just 2003,
which is why I didn't go the VSTO2005 route).
- If I write a stand-alone VB.NET app that get's a new _app, i.e. outside
the AddIn Outlook.ApplicationClass, then the COMAddIn.Object are always
'null' too, even though they 'run' and are shown '.Connected=true'

Any help, ideas etc most appreciated...

"Dave Kane [MVP - Outlook]" wrote:

I haven't tried this but I assume that you already tried the equivalent
of
your in-page jscript and that didn't work. You can get to an add-in in
the
running Outlook session from IE hosted in a FHP, but a standalone browser
has different security barriers. Perhaps your UserControl, even though
it's
hosted in the FHP, is hitting those barriers. Do you need to reach the
add-in instance that Outlook loaded on startup, or just access Outlook
data?


"David Ing" wrote in message
...
Hello,

I have a .NET winforms UserControl hosted inside a HTML page which is
referenced as a Outlook Folder Home Page. (Kind of like the recent MSFT
CRM
Integration example)

The .NET UserControl is initialized by using the following bit of
jscript
in
the HTML:

var oApp = window.external.OutlookApplication;
SomeControl.Initialize(oApp);

So what I need some info around is this: How do I, from my .NET
UserControl,
gain access back into my .NET Outlook Add-in instance?

Paraphrased, I need to be able to call .NET functions from my
UserControl
(the one hosted in the HTML page) back into the Outlook-Addin.

In jscript, in the same HTML page, I can reference the Add-In using the
COMAddIns enumeration, i.e (roughly):

var addin = app.COMAddIns.Item("MyAddIn.Connect");
var h = addin.Object;
h.AdotNetFunctionInMyAddIn("hello")

But how would I do this from within my .NET UserControl in C#?

Any help, clues, ideas appreciated. Thanks!
David






  #5  
Old March 2nd 06, 12:27 PM posted to microsoft.public.outlook.program_vba
David Ing
external usenet poster
 
Posts: 7
Default .NET AddIn Question UserControl in Folder homepage


Yes, I tried passing it via the jscript but it always comes through null.
Here's a snippet to show what I mean:

html
body rightmargin = '0' leftmargin ='0' topmargin ='0' bottommargin = '0'
onload='OnBodyLoad()'
script
function OnBodyLoad()
{
var oApp = window.external.OutlookApplication;
var oAddIn = oApp.COMAddIns.Item("MyAddIn1.Connect");
var oAddInObject = oAddIn.Object;

alert(oAddInObject.RenderHello());

MyControl1.Initialize(oApp, oAddInObject);
}
/script
object classid='clsid:df2812cc-f549-459c-b945-dae067fcb04a' ID='MyControl1'
VIEWASTEXT width='100%' height='100%'/
/body
/html

So the alert works fine, i.e. calls into the AddIn and returns the correct
value. It's just the oAddInObject in the usercontrol Initialize method is
always null. The oApp reference comes through fine. The UserControl work
fine. But no ref to the AddIn...

Thanks for any help, this is driving me insane now :-)


"Dave Kane [MVP - Outlook]" wrote:

Have you tried passing the COMAddIn object from the jscript to the
UserControl (i.e. add another parameter to the Initialize method that
accepts the object)? Just a thought, you'll probably hit the same barrier
you're hitting now but maybe you'll get a useful exception. Also, at this
point
addins = olapp.COMAddIns
can you get a value for addins.Count? If not does it throw an exception? If
it does, can you iterate through the collection?

"David Ing" wrote in message
...
Thanks for the reply Dave.

I have tried the moral equivalent of the jscript in .NET, but it seems to
come down the following problems:

- When I get back the AddIns collection from within .NET, i.e. with this:

Dim o As Microsoft.Office.Core.COMAddIn
Dim addins As Microsoft.Office.Core.COMAddIns
addins = olapp.COMAddIns
o = addins.Item("TheRightProgId")

..then the COMAddIn.Item.Object is alway 'null'.

- I know that I can access the object because the jscript (the one that
actually launchs the .NET UserControl) works fine, i.e. can use the
COMAddIn
.Object just fine.

Also, to be clear, I need info/funcitonality from my AddIn, not just
general
Outlook info.

More Background, in case it's useful:

- This is a .NET 1.1 Shimmed Outlook Add-in written in C#
- Using Outlook 2003 (although I need it to work for more than just 2003,
which is why I didn't go the VSTO2005 route).
- If I write a stand-alone VB.NET app that get's a new _app, i.e. outside
the AddIn Outlook.ApplicationClass, then the COMAddIn.Object are always
'null' too, even though they 'run' and are shown '.Connected=true'

Any help, ideas etc most appreciated...

"Dave Kane [MVP - Outlook]" wrote:

I haven't tried this but I assume that you already tried the equivalent
of
your in-page jscript and that didn't work. You can get to an add-in in
the
running Outlook session from IE hosted in a FHP, but a standalone browser
has different security barriers. Perhaps your UserControl, even though
it's
hosted in the FHP, is hitting those barriers. Do you need to reach the
add-in instance that Outlook loaded on startup, or just access Outlook
data?


"David Ing" wrote in message
...
Hello,

I have a .NET winforms UserControl hosted inside a HTML page which is
referenced as a Outlook Folder Home Page. (Kind of like the recent MSFT
CRM
Integration example)

The .NET UserControl is initialized by using the following bit of
jscript
in
the HTML:

var oApp = window.external.OutlookApplication;
SomeControl.Initialize(oApp);

So what I need some info around is this: How do I, from my .NET
UserControl,
gain access back into my .NET Outlook Add-in instance?

Paraphrased, I need to be able to call .NET functions from my
UserControl
(the one hosted in the HTML page) back into the Outlook-Addin.

In jscript, in the same HTML page, I can reference the Add-In using the
COMAddIns enumeration, i.e (roughly):

var addin = app.COMAddIns.Item("MyAddIn.Connect");
var h = addin.Object;
h.AdotNetFunctionInMyAddIn("hello")

But how would I do this from within my .NET UserControl in C#?

Any help, clues, ideas appreciated. Thanks!
David






  #6  
Old March 2nd 06, 04:23 PM posted to microsoft.public.outlook.program_vba
Dave Kane [MVP - Outlook]
external usenet poster
 
Posts: 33
Default .NET AddIn Question UserControl in Folder homepage

So if you try to instantiate the COMAddIns collection within the UserControl
from the oApp objec that you passed in, what do you get? Does it return a
Count and does it match what you get in the page code? If it throws an
exception what is it?

"David Ing" wrote in message
...

Yes, I tried passing it via the jscript but it always comes through null.
Here's a snippet to show what I mean:

html
body rightmargin = '0' leftmargin ='0' topmargin ='0' bottommargin = '0'
onload='OnBodyLoad()'
script
function OnBodyLoad()
{
var oApp = window.external.OutlookApplication;
var oAddIn = oApp.COMAddIns.Item("MyAddIn1.Connect");
var oAddInObject = oAddIn.Object;

alert(oAddInObject.RenderHello());

MyControl1.Initialize(oApp, oAddInObject);
}
/script
object classid='clsid:df2812cc-f549-459c-b945-dae067fcb04a'
ID='MyControl1'
VIEWASTEXT width='100%' height='100%'/
/body
/html

So the alert works fine, i.e. calls into the AddIn and returns the correct
value. It's just the oAddInObject in the usercontrol Initialize method is
always null. The oApp reference comes through fine. The UserControl work
fine. But no ref to the AddIn...

Thanks for any help, this is driving me insane now :-)


"Dave Kane [MVP - Outlook]" wrote:

Have you tried passing the COMAddIn object from the jscript to the
UserControl (i.e. add another parameter to the Initialize method that
accepts the object)? Just a thought, you'll probably hit the same barrier
you're hitting now but maybe you'll get a useful exception. Also, at this
point
addins = olapp.COMAddIns
can you get a value for addins.Count? If not does it throw an exception?
If
it does, can you iterate through the collection?

"David Ing" wrote in message
...
Thanks for the reply Dave.

I have tried the moral equivalent of the jscript in .NET, but it seems
to
come down the following problems:

- When I get back the AddIns collection from within .NET, i.e. with
this:

Dim o As Microsoft.Office.Core.COMAddIn
Dim addins As Microsoft.Office.Core.COMAddIns
addins = olapp.COMAddIns
o = addins.Item("TheRightProgId")

..then the COMAddIn.Item.Object is alway 'null'.

- I know that I can access the object because the jscript (the one that
actually launchs the .NET UserControl) works fine, i.e. can use the
COMAddIn
.Object just fine.

Also, to be clear, I need info/funcitonality from my AddIn, not just
general
Outlook info.

More Background, in case it's useful:

- This is a .NET 1.1 Shimmed Outlook Add-in written in C#
- Using Outlook 2003 (although I need it to work for more than just
2003,
which is why I didn't go the VSTO2005 route).
- If I write a stand-alone VB.NET app that get's a new _app, i.e.
outside
the AddIn Outlook.ApplicationClass, then the COMAddIn.Object are always
'null' too, even though they 'run' and are shown '.Connected=true'

Any help, ideas etc most appreciated...

"Dave Kane [MVP - Outlook]" wrote:

I haven't tried this but I assume that you already tried the
equivalent
of
your in-page jscript and that didn't work. You can get to an add-in in
the
running Outlook session from IE hosted in a FHP, but a standalone
browser
has different security barriers. Perhaps your UserControl, even though
it's
hosted in the FHP, is hitting those barriers. Do you need to reach the
add-in instance that Outlook loaded on startup, or just access Outlook
data?


"David Ing" wrote in message
...
Hello,

I have a .NET winforms UserControl hosted inside a HTML page which
is
referenced as a Outlook Folder Home Page. (Kind of like the recent
MSFT
CRM
Integration example)

The .NET UserControl is initialized by using the following bit of
jscript
in
the HTML:

var oApp = window.external.OutlookApplication;
SomeControl.Initialize(oApp);

So what I need some info around is this: How do I, from my .NET
UserControl,
gain access back into my .NET Outlook Add-in instance?

Paraphrased, I need to be able to call .NET functions from my
UserControl
(the one hosted in the HTML page) back into the Outlook-Addin.

In jscript, in the same HTML page, I can reference the Add-In using
the
COMAddIns enumeration, i.e (roughly):

var addin = app.COMAddIns.Item("MyAddIn.Connect");
var h = addin.Object;
h.AdotNetFunctionInMyAddIn("hello")

But how would I do this from within my .NET UserControl in C#?

Any help, clues, ideas appreciated. Thanks!
David








 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Net folder Heidi Outlook - Using Forms 9 July 24th 07 06:34 PM
Issues with .NET addin, web-services, and shimming Sergey Anchipolevsky Add-ins for Outlook 0 February 22nd 06 01:26 PM
Hummingbird Addin Danny Add-ins for Outlook 0 February 4th 06 08:00 PM
Outlook addin help Melbin Outlook - Using Forms 0 January 24th 06 01:12 PM
Cannot Create Folder -- VB.NET Randy Given Outlook - General Queries 0 January 10th 06 02:50 AM


All times are GMT +1. The time now is 11:33 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.