Solved

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

Posted on 2003-10-27
6
486 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now