private void Button2_Click(object sender, System.EventArgs e) { try { test = new CCWordApp(); //test.Open (ConfigurationSettings.AppSettings["WordMod"] + "normal.dot"); test.Open(); test.SetFontName("Arial"); test.SetFontSize(14); test.SetAlignment("Center"); test.SetFont("Bold"); test.InsertText(DocName.Text + ".doc"); test.SetFont("nothing"); test.SetAlignment("Left"); test.InsertLineBreak(5); test.SetFontSize(8); test.InsertText(Text.Text); test.SaveAs(ConfigurationSettings.AppSettings["WordDoc"] + DocName.Text + ".doc"); // Save in html format test.SaveAsHtml(ConfigurationSettings.AppSettings["WordDoc"] + DocName.Text + ".html"); test.Quit(); } catch (Exception exc) { StatusMessage.Text = exc.Message; StatusMessage.Visible = true; test.Quit(); } }
protected void Button2_Click(object sender, System.EventArgs e) { DateTime dated; dated = DateTime.Now; try { test = new CCWordApp(); test.Open(ConfigurationSettings.AppSettings["WordMod"] + "table.dot"); test.GoToTheTable(1); test.GoToDownCell(); test.InsertText(Riga1Text1.Text); test.GoToRightCell(); test.InsertText(Riga1Text2.Text); test.SaveAs(ConfigurationSettings.AppSettings["WordDoc"] + DocName.Text + ".doc"); // Save in html format test.SaveAsHtml(ConfigurationSettings.AppSettings["WordDoc"] + DocName.Text + ".html"); test.Quit(); } catch (Exception exc) { StatusMessage.Text = exc.Message; StatusMessage.Visible = true; test.Quit(); } }
private void Button2_Click(object sender, System.EventArgs e) { DateTime dated; dated = DateTime.Now; try { test = new CCWordApp(); test.Open(ConfigurationSettings.AppSettings["WordDoc"] + DocName.Text + ".doc"); test.GoToTheEnd(); test.SetAlignment("Right"); test.SetFont("nothing"); test.InsertText(dated.ToShortDateString()); test.InsertLineBreak(); test.InsertText(Text.Text); test.Save(); // Save in html format test.SaveAsHtml(ConfigurationSettings.AppSettings["WordDoc"] + DocName.Text + ".html"); test.Quit(); } catch (Exception exc) { StatusMessage.Text = exc.Message; StatusMessage.Visible = true; test.Quit(); } }
private void Button2_Click(object sender, System.EventArgs e) { DateTime dated; dated = DateTime.Now; try { test = new CCWordApp(); test.Open(ConfigurationSettings.AppSettings["WordMod"] + "template1.dot"); test.SetAlignment("Center"); test.GotoBookMark("Title"); test.SetFont("Bold"); test.InsertText(TextTitle.Text); test.SetFont("nothing"); test.GotoBookMark("name"); test.SetFont("Italic"); test.InsertText(TextName.Text); test.SetFont("nothing"); test.GotoBookMark("address"); test.SetAlignment("Right"); test.InsertText(dated.ToShortDateString()); test.InsertLineBreak(); test.InsertText(TextAddress.Text); test.SetFont("nothing"); test.SaveAs(ConfigurationSettings.AppSettings["WordDoc"] + DocName.Text + ".doc"); // Save in html format test.SaveAsHtml(ConfigurationSettings.AppSettings["WordDoc"] + DocName.Text + ".html"); test.Quit(); } catch (Exception exc) { StatusMessage.Text = exc.Message; StatusMessage.Visible = true; test.Quit(); } }