 |
|
ถามเรื่องการออกรายงานทาง Ms.Word ของภาษา C# ในโปรแกรม Visual Studio 2005 |
|
 |
|
|
 |
 |
|

Code (C#)
object mis = Type.Missing;
object strFileName = (Object)"C:\\WordC\\Doc\\GenWord.doc";
object fileFormat = 1;
Object oTrue = true;
Object oFalse = false;
Word.Application oWord = new Word.Application();
Word.Document oWordDoc = new Word.Document();
oWord.Visible = true;
oWordDoc = oWord.Documents.Add(ref mis, ref mis, ref mis, ref mis);
oWord.Selection.TypeText("Welcome To www.ThaiCreate.Com");
oWordDoc.SaveAs(ref strFileName, ref fileFormat, ref mis, ref mis,
ref mis, ref mis, ref mis, ref mis, ref mis,
ref mis, ref mis, ref mis, ref mis, ref mis,
ref mis, ref mis);
oWordDoc.Close(ref oFalse, ref mis, ref mis);
oWord.Quit(ref mis, ref mis, ref mis);
GC.Collect();
Go to : C# .NET Create Word Document (Windows 7 and Office 2003 , Office Word 2007)
|
 |
 |
 |
 |
Date :
2011-09-08 22:29:38 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|