473,387 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

popup documents

hello.
am doing c# windows application and i need some help.
is it possible to read a .doc file and to be display in the screen with the microsoft office??
am able to read a file and display it in a messagebox but i don't know how to display it in microsoft office.
can someone help me please???
Mar 3 '08 #1
7 1140
dip_developer
648 Expert 512MB
hello.
am doing c# windows application and i need some help.
is it possible to read a .doc file and to be display in the screen with the microsoft office??
am able to read a file and display it in a messagebox but i don't know how to display it in microsoft office.
can someone help me please???
try this................

Expand|Select|Wrap|Line Numbers
  1.  
  2.     ///Setup environment for Word application 
  3.     Word.Application objWord; 
  4.     Word.Document objDoc; 
  5.     string strFile; 
  6.  
  7.     ///Instansiate Microsoft Word 
  8.     objWord = new Word.Application(); 
  9.     ///Allow session to be visible 
  10.     objWord.Visible = true; 
  11.     ///Define source file container and name 
  12.     strFile = TextBox1.Text; 
  13.     ///Open the document 
  14.     objDoc = objWord.Documents.Open(strFile); 
  15.  
Mar 3 '08 #2
it give me this error
Error 1 The type or namespace name 'Word' could not be found (are you missing a using directive or an assembly reference?)
i try to add a namespace for word but i can find anything.
could you please help me?
instead of ms word is it possible to use and pdf???
Mar 3 '08 #3
Plater
7,872 Expert 4TB
You need to add a reference to the MS office DLLs so that you can work with the office objects/APIs.
Mar 3 '08 #4
dip_developer
648 Expert 512MB
it give me this error
Error 1 The type or namespace name 'Word' could not be found (are you missing a using directive or an assembly reference?)
i try to add a namespace for word but i can find anything.
could you please help me?
instead of ms word is it possible to use and pdf???
Right click on the Reference node of your .net solution......then
Add Reference------>on Add Reference window go to COM tab-----> locate Microsoft Office 11.0 Object Library------>Click Select button---the OK.....
it will add the reference of the required DLL to work with Microsoft WORD
Mar 4 '08 #5
Right click on the Reference node of your .net solution......then
Add Reference------>on Add Reference window go to COM tab-----> locate Microsoft Office 11.0 Object Library------>Click Select button---the OK.....
it will add the reference of the required DLL to work with Microsoft WORD

There is Microsoft Office 12.0 Object Library and not what you have told me.did it do any different because it still give me tha same error?
Mar 4 '08 #6
Plater
7,872 Expert 4TB
The library you have is based on what version of office you have.
11 is very common. 12 is probably officexp?
At any rate, do some conscious thinking and use THAT one then.
These things can easily be looked up on google.
Mar 5 '08 #7
thxs.it was very helpfull and is working
Mar 11 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Moon | last post by:
Seems I still haven't got the hang of all those window generating code in Javascript. I've got a page with about 15 photo thumbnails. When you click on a thumbnail a new window pops up which shows...
5
by: Obantec Support | last post by:
Hi i leached some code and strung together a popup i need for a page with 5 help buttons. Now i could use 5 scripts and pre-load the values but i would rather get a better understanding of how...
38
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find...
16
by: Greg G | last post by:
I'm trying to open a popup window and then set some data, but I can't seem to make it work. I'm sure I'm missing something obvious. popwin = document.open('mypop.html', \"external\", \"width=\"...
7
by: E Michael Brandt | last post by:
I have been lurking here for some time, and now would like to ask a question of you clever coders: My JustSo PictureWindow 3 Extension for Dreamweaver has stumbled in the face of the new Opera...
8
by: Orloff | last post by:
Hi, on most (all?) browsers, when you put the pointer on a <a href="..." title="popup text">this is a link</a> without clicking on the link, there is a popup caption with the "popup text". I...
2
by: Jenny | last post by:
Hi all, how can place a popup window relative to the assigned button instead of relative to the documents body? I'm using: oPopup.show(15,150,50,50,document.body); But the popup is shown if...
3
by: delraydog | last post by:
I'm having a problem trying to use a single DIV object for a popup menu when I'm using embedded IFrames. All the IFrames have the same parent document but I can't make the popup appear inside of...
7
by: anthony.turcotte | last post by:
Hi, I've looked for a solution to this problem on google, read posts in this newsgroup and I still haven't found anything that could help me. Here's the scenario. 1. User accesses...
3
by: RahimAsif | last post by:
I am writing an application that requires the a portion of the main menu to be dynamic. The menu has file, panels, view files and help across the top. The view files sub menu needs to be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.