Solved

Embed (just display) a Word Document into a C# App

Posted on 2003-10-27
6
492 Views
Last Modified: 2012-05-04
Hi,

Is there a way to embed a word document into a c# application?

I heared somewhere that its possible to embed an internet explorer window(which could display a word file) but i don't know how...


thanks in advance...
0
Comment
Question by:eliaZ
  • 3
  • 2
6 Comments
 
LVL 2

Expert Comment

by:smitty22
ID: 9628415
How are you wanting to display it?  Do you want to actually bring up an instance of MS Word outside of your app, or do you want to load it, say, within a form you've created?  -- For example, like the way Internet Explorer internally loads an instance of Acrobat Reader when it displays a PDF file.
0
 

Author Comment

by:eliaZ
ID: 9630180
Like internet explorer does the PDF thing :)
0
 
LVL 6

Accepted Solution

by:
purpleblob earned 500 total points
ID: 9665520
You can certainly use the IE control and and the Navigate method to load up PDF's, Word doc etc. in a IE container. However this does not merge Adobe Acrobat or Word menus into your applications it just displays the control.

To do this, simply add a reference to the shdocwv.dll (on Win2000 it'll be in c:\winnt\system32 other Windows versions will be similar) - now create an instance of the browser, i.e.             

private AxSHDocVw.AxWebBrowser browser;

Now to display your PDF simply do the following

object nothing = null;
browser.Navigate(@"c:\Manual.PDF", ref nothing, ref nothing, ref nothing, ref nothing);

This will (or should :-) ) display the PDF in the browser control.

You can ofcourse add the web browser control to your toolbox and use the visual designer to place/size etc. the browser control if you prefer.

Hope this helps
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:eliaZ
ID: 9665560
thanks :)

it would have been a A if you'd explained  me how to add this control to the toolbox (add -> com components, microsoft web browser)

(i already found out, but failed to delete this question :))

thx
0
 
LVL 6

Expert Comment

by:purpleblob
ID: 9665571
Ah well I can't win them all :-)
0
 

Author Comment

by:eliaZ
ID: 9665590
:)
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question