Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2003-10-27
6
Medium Priority
?
502 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 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
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!

 

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
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…

715 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