Senior & Expert .Net Developers Discussion Forum by Nyros Technologies

HIRE .Net Expert Developers Programmers Coders From India
Ruby on Rails PHP .Net Developers Community, Nyros Technologies, Kakinada
 
Log in  or IF not a member please REGISTER
Username:
Password:   


Keyword
Log in | Profile 

winWord process is running, but i can't see the document.

 
Post new topic   Reply to topic    Senior & Expert .Net Developers Discussion Forum by Nyros Technologies Index -> Programming with C#
View previous topic :: View next topic  
Author Message
Kittu



Joined: 21 Aug 2007
Posts: 67

PostPosted: Tue Jun 23, 2009 7:01 am    Post subject: winWord process is running, but i can't see the document. Reply with quote

Hi experts,

I am developing an application like opening a word document through c# coding. my problem is the word process is running but i can't see the document. here is my code down below.

string Path = @"C:\doc2.doc";
Microsoft.Office.Interop.Word.ApplicationClass wordApp = new Microsoft.Office.Interop.Word.ApplicationClass();

object file = Path;

object nullobj = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Open(ref file, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj);
doc.Close(ref nullobj, ref nullobj, ref nullobj);
wordApp.Quit(ref nullobj, ref nullobj, ref nullobj);


Please help me in this issue...it is very urgent....

thanks
kittu
Back to top
View user's profile Send private message
Raghavendra



Joined: 21 Aug 2007
Posts: 215

PostPosted: Tue Jun 30, 2009 3:29 am    Post subject: Reply with quote

Hello Kittu,

You forgot to place this line of code 'doc.Activate();'. Now place this code and let me know your problem fixes or not.

string Path = @"C:\doc2.doc";
Microsoft.Office.Interop.Word.ApplicationClass wordApp = new Microsoft.Office.Interop.Word.ApplicationClass();

object file = Path;

object nullobj = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Open(ref file, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj);
Arrow doc.Activate();
doc.Close(ref nullobj, ref nullobj, ref nullobj);
wordApp.Quit(ref nullobj, ref nullobj, ref nullobj);


Bye...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Senior & Expert .Net Developers Discussion Forum by Nyros Technologies Index -> Programming with C#
Page 1 of 1

 latest topics 
 Topics   Replies   Author   Views   Last Post 
No new posts How to install iPhone SDK?
0 Ramya sree 12 Fri Mar 12, 2010 11:17 am
Ramya sree View latest post
No new posts Parsing XML using SAX parser in Android
0 vijayalakshmi 11 Fri Mar 12, 2010 4:41 am
vijayalakshmi View latest post
No new posts Show Notification in Status Bar in Android Application
0 vijayalakshmi 23 Tue Mar 09, 2010 9:36 am
vijayalakshmi View latest post
No new posts Changing the date and time in SQL Server using T-SQL
0 muralikrishna 35 Fri Mar 05, 2010 3:18 pm
muralikrishna View latest post
No new posts Using TableLayout in Android Layout file:
0 vijayalakshmi 36 Fri Mar 05, 2010 5:03 am
vijayalakshmi View latest post
No new posts TabActivity with Intents in Android:
0 vijayalakshmi 36 Fri Mar 05, 2010 4:46 am
vijayalakshmi View latest post
No new posts Show different components in different styles in Android?
0 vijayalakshmi 35 Fri Mar 05, 2010 3:39 am
vijayalakshmi View latest post
No new posts VIEWSTATE SIZE BYTES SHOWS 0 IN TRACE.AXD
1 sanjoo8959 47 Wed Mar 03, 2010 9:18 am
Dileep View latest post
No new posts How to mark incoming Sms as read in Android programatically?
0 vijayalakshmi 39 Mon Mar 01, 2010 1:12 pm
vijayalakshmi View latest post
No new posts How to control(Start,Stop) windows Services in C#?
0 Raghavendra 45 Mon Mar 01, 2010 12:57 pm
Raghavendra View latest post




Hire an expert .Net developer / coder / programmer or development team from India now!!

Other Forums : Ruby on Rails   ::   PHP   |   Free unlimited HTML CSS templates download

Nyros Technologies   |   Kakinada City Portal   |   Developers Blog   |   About .Net Experts   |   More