// Modify to suit your machine: // Get the Word application object. Word._Application word_app = new Word.Application(); // Make Word visible (optional). word_app.Visible = true; object oEndOfDoc = "\\endofdoc"; // Create the Word document. object missing = Type.Missing; Word._Document word_doc = word_app.Documents.Add( ref missing, ref missing, ref missing, ref missing); // Create a header paragraph. Word.Paragraph para = word_doc.Paragraphs.Add(ref missing); para.Range.Text = "Chrysanthemum Curve"; //para.Range.Text = "Curve"; object style_name = "Heading 1"; para.Range.set_Style(ref style_name); para.Range.InsertParagraphAfter(); // Add more text. Curve" para.Range.Text = "To make a chrysanthemum curve, " + "use the following parametric equations as t goes " + "from 0 to 21 * ? to generate " + "points and then connect them."; para.Range.InsertParagraphAfter(); string qa = ""; qa = para.Range.Text.Substring(1, 2); // Save the current font and start using Courier New. string old_font = para.Range.Font.Name; para.Range.Font.Name = "Courier New"; para.Range.Font.ColorIndex = Microsoft.Office.Interop.Word.WdColorIndex.wdByAuthor; // Add the equations. para.Range.Text = " r = 5 * (1 + Sin(11 * t / 5)) -\n" + " 4 * Sin(17 * t / 3) ^ 4 *\n" + " Sin(2 * Cos(3 * t) - 28 * t) ^ 8\n" + " x = r * Cos(t)\n" + " y = r * Sin(t)"; // Start a new paragraph and then // switch back to the original font. para.Range.InsertParagraphAfter(); para.Range.Font.Name = old_font;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)