How to write an OLE object in .NET?

T

Thomas

Hi everybody!

I am stuck with a problem that should be simple, so maybe you could point me
in the right direction, maybe even with example code? That would be very much
appreciated.

I want to write a program (MyApp) that can be embedded into MS Office as an
OLE Object. So I want to be a able to do Insert->Object->MyApp, and then edit
this object within MS Office using my program. And if at all possible, I want
to do that in .NET using C# or managed C#.

The only example I could find is the infamous notepad. Unfortunately it is
written using MFC and veyr sparsely documented, so it is difficult for me to
see what is going on there. (Not much, I would guess, because most things
happen inside MFC.)

I also noticed that OLE has been renamed/relaunched/superseeded several
times, so I also searched for "automation server", "activex component" and
"winforms". But I didn't find any useful information there either. Has the
idea of in-process embedding of objects been abandoned? That would be a
shame, because I think it is a rather powerful way of creating documents.

So at this point I would be very glad for any help how to create an OLE
embeddable object. If it is not possible in .NET, I would even go the extra
mile and do it in MFC.

Yours,
Thomas
 
C

Cindy M.

Hi Thomas,

I don't really have an answer for you, except to say that currently embedded OLE
objects are very much in use in Office. Whether they will be in the future I
simply do not know.

You could try asking this in the dotnet.framework.interop newsgroup. Someone
there might have some advice for you
http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?dg=micro
soft.public.dotnet.framework.interop&cat=en_us_58598dd7-357a-4884-86b1-fc3ec838c
ba4&lang=en&cr=us
I am stuck with a problem that should be simple, so maybe you could point me
in the right direction, maybe even with example code? That would be very much
appreciated.

I want to write a program (MyApp) that can be embedded into MS Office as an
OLE Object. So I want to be a able to do Insert->Object->MyApp, and then edit
this object within MS Office using my program. And if at all possible, I want
to do that in .NET using C# or managed C#.

The only example I could find is the infamous notepad. Unfortunately it is
written using MFC and veyr sparsely documented, so it is difficult for me to
see what is going on there. (Not much, I would guess, because most things
happen inside MFC.)

I also noticed that OLE has been renamed/relaunched/superseeded several
times, so I also searched for "automation server", "activex component" and
"winforms". But I didn't find any useful information there either. Has the
idea of in-process embedding of objects been abandoned? That would be a
shame, because I think it is a rather powerful way of creating documents.

So at this point I would be very glad for any help how to create an OLE
embeddable object. If it is not possible in .NET, I would even go the extra
mile and do it in MFC.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
R

Richard2ne1

Thomas,

Did you ever get / work out an answer as to how to achieve this? I'm trying
to do the same sort of thing; write an OLE server / ActiveX Component,
whatever they choose to call it now, mainly to insert object into Excel.

I'm trying to do it in VB.NET 2005 Express, but can't find any references at
all how to go about such a project.

Quite ridiculous, since at this rate I'm going back to VB6 where it is simple!

All help appreciated

Alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top