Solved

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

Posted on 2003-10-27
6
500 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

627 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