1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Word._Application aWord;
Word._Document aDoc;
aWord = new Word.Application();
aWord.Visible = true; // false pour cacher Word
object aEndOfDoc = "\\endofdoc";
//Une valeur pratique qui sert de parametres pour des fonctions dont on ne connait pas tout
//les arguments.
object Missing = System.Reflection.Missing.Value;
//Creation d'un nouveau document orientée paysage
aDoc = aWord.Documents.Add(ref Missing, ref Missing, ref Missing, ref Missing);
aDoc.PageSetup.Orientation = Word.WdOrientation.wdOrientLandscape;
//Nouveau paragrapheWord.Paragraph aPara;
aPara = aDoc.Content.Paragraphs.Add(ref Missing);
aPara.Range.Text = "Salut !!";
aPara.Range.Font.Bold = 1;
aPara.Range.Font.Size = 24;
aPara.Range.Font.NameAscii = "Courier New";
aPara.Range.InsertParagraphAfter(); |
Partager