Q about embedding Word and Excel

N

NinuX

Hi,

I want to embed Word and Excel in my VB.NET application. I am using Visual
Studio 2005 and targetting the .NET framework v2.0

Could someone point me in the right direction, I am not sure which
technology to use for this, basically, I want my users to be able to create
and edit documents in the same manner that Outlook uses Word for editing
e-mails and the Web browser embeds these office products in it's own window

I cannot work out whtehr to use COM interop, or if there is a .NET assembly
available, does the VSTO 2005 apply to this ?

Thanks
 
C

Cindy M.

Hi =?Utf-8?B?TmludVg=?=,
I want to embed Word and Excel in my VB.NET application. I am using Visual
Studio 2005 and targetting the .NET framework v2.0

Could someone point me in the right direction, I am not sure which
technology to use for this, basically, I want my users to be able to create
and edit documents in the same manner that Outlook uses Word for editing
e-mails and the Web browser embeds these office products in it's own window

I cannot work out whtehr to use COM interop, or if there is a .NET assembly
available, does the VSTO 2005 apply to this ?
You definitely have to use COM-Interop. And the Office application has to be
installed and licensed on the client machine. There aren't any "classes" that
provide Office app functionality for you to use, and there aren't any
runtimes.

There are a couple of controls around that can be used for hosting, such as
DSOFramer
http://support.microsoft.com/?id=311765

or the WebBrowser control
http://support.microsoft.com/search/default.aspx?catalog=LCID=1033&spid=glob
al&query=WebBrowser+control+Office&adv=&ast=1%2C2%2C3%2C4%2C7%2C8%2C9&mode=a&c
at=False&kt=ALL&title=false&mdt=&pwt=False&res=20&1033comm=1

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 :)
 
N

NinuX

Thanks Cindy,
I tried the DSOFramer and it worked reasonaby well. Is there any way of
setting it to ReadOnly mode to stop users from editing the Word / Excel
document being viewed, and is there any way of switching off some of it's
file commands such as "save as" or "open" ?

Thanks
 
C

Cindy M.

Hi =?Utf-8?B?TmludVg=?=,
I tried the DSOFramer and it worked reasonaby well. Is there any way of
setting it to ReadOnly mode to stop users from editing the Word / Excel
document being viewed, and is there any way of switching off some of it's
file commands such as "save as" or "open" ?
I'm afraid I'm not the person to help you with this. There have been
discussions on using DSOFramer in the various Office.development newsgroups.
You might try a search on Google or some other search engine to see what you
can turn up.

As far as the file commands are concerned, you need to automate the Word /
Excel application IN the container. You can work with the CommandBars
collections directly to change what the user sees in the menus and toolbars.
You should probably also disable the key commands such as Ctrl+S (in Word,
that's the KeyBindings collection; can't tell you about Excel). With Word,
be careful to set the correct CustomizationContext so that you don't mess up
the Word application, in general.

Note that in your original message you mention "create and edit documents".
If you don't want users to DO anything with the files, then I submit that
displaying them in the application windows is probably not the best
approach. Especially with Word... The applications simply weren't designed
to function as "Viewers".

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 :)
 

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