private void CargarCompeteciasTecnicas(Word.Range rng_datos, DataView dv) { Word.Paragraph oParagraph = rng_datos.Paragraphs.Add(); oParagraph.Range.ListFormat.ApplyBulletDefault(); int i = 0; foreach (DataRowView oFila in dv) { string sDato = oFila["T036_DESCRIPCION"].ToString(); if (i < dv.Table.Rows.Count - 1) { sDato = sDato + "\n"; } oParagraph.Range.InsertBefore(sDato); i++; } }
public TestResult DoTest() { Word.Application application = null; DateTime startTime = DateTime.Now; try { application = COMObject.Create <Word.Application>(COMObjectCreateOptions.CreateNewCore); Word.Document document = application.Documents.Add(); application.DisplayAlerts = WdAlertLevel.wdAlertsNone; application.Selection.TypeText("Test with TabIntend C#"); application.Selection.Start = 0; Word.Paragraph p = document.Application.Selection.Range.Paragraphs[1]; p.IndentCharWidth(10); p.IndentFirstLineCharWidth(8); p.Space1(); p.Space15(); p.Space2(); p.TabHangingIndent(5); p.TabIndent(3); return(new TestResult(true, DateTime.Now.Subtract(startTime), "", null, "")); } catch (Exception exception) { return(new TestResult(false, DateTime.Now.Subtract(startTime), exception.Message, exception, "")); } finally { if (null != application) { application.Quit(WdSaveOptions.wdDoNotSaveChanges); application.Dispose(); } } }