Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2003-10-27
6
Medium Priority
?
504 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 1500 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
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…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

824 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