TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
eagle weir
NA
6
0
Open word document without showing in task bar
Oct 8 2006 1:11 AM
I try to use Microsoft Word 10.0 Object Library to open doc file, I not want to display word application on the screen, but it show on the task bar each time . Below is my code,How to fix it? Thanks. Object objFalse = false; Object objTrue = true; object missing = System.Reflection.Missing.Value; object emptyData = String.Empty; Word.Application wordApp = new Word.Application(); Word.Document doc = new Word.Document(); wordApp.Visible = false; wordApp.WindowState = Word.WdWindowState.wdWindowStateMinimize; try { foreach (String fileName in fileNames) { Object objFileName = fileName; doc = wordApp.Documents.Open(ref objFileName, ref objFalse, ref objTrue, ref objFalse, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref objFalse, ref missing, ref missing, ref missing); wordApp.Visible = false; wordApp.WindowState = Word.WdWindowState.wdWindowStateMinimize; doc.ActiveWindow.Selection.WholeStory(); doc.ActiveWindow.Selection.Copy(); IDataObject data = Clipboard.GetDataObject(); this.wordText += data.GetData(DataFormats.Text).ToString(); Clipboard.SetDataObject(String.Empty); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { wordApp.Documents.Close(ref objFalse, ref missing, ref missing); wordApp.Application.Quit(ref objFalse, ref missing, ref missing); } }
Reply
Answers (
0
)
Drop and Drag Text File into RichTextBox - file opens but icon appears
creating text document in c#