VS2010 操作Word(六)测试结果
2013-02-26 09:25
218 查看
下面的是调用操组word的代码:
CJG_WordApi wordOpt;
wordOpt.CreateAPP();
wordOpt.CreateDocument();
wordOpt.SetPageSetup();
wordOpt.SetParaphformat(3);
wordOpt.SetFont(_T("黑体"),28,/*26367*/13107230);
wordOpt.WriteText(_T("测试"));
wordOpt.NewLine();
wordOpt.SetFont(_T("华文细黑"),12);
wordOpt.CreateTable(3,5);
wordOpt.WriteCellText(1,1,_T("测试"));
wordOpt.WriteCellText(1,2,_T("测试"));
wordOpt.WriteCellText(1,3,_T("测试"));
wordOpt.WriteCellText(1,4,_T("测试"));
wordOpt.WriteCellText(1,5,_T("测试"));
wordOpt.SetTableShading(1,1,13107230);
wordOpt.SetTableShading(1,2,13107230);
wordOpt.SetTableShading(1,3,13107230);
wordOpt.SetTableShading(1,4,13107230);
wordOpt.SetTableShading(1,5,13107230);
wordOpt.WriteCellText(2,1,_T(""));
wordOpt.SetFont(_T("华文细黑"),12);
wordOpt.CreateBookMark(_T("书签1"));
wordOpt.CreateHyperLink(_T("超链接1"),_T("书签2"));
wordOpt.WriteCellText(2,2,_T("测试"));
wordOpt.WriteCellText(2,3,_T("测试"));
wordOpt.WriteCellText(2,4,_T("测试"));
wordOpt.WriteCellText(2,5,_T("测试"));
wordOpt.WriteCellText(3,1,_T("测试"));
wordOpt.WriteCellText(3,2,_T("测试"));
wordOpt.WriteCellText(3,3,_T("测试"));
wordOpt.WriteCellText(3,4,_T("测试"));
wordOpt.WriteCellText(3,5,_T("测试"));
wordOpt.EndLine();
wordOpt.NewLine(3);
//wordOpt.PageBreak();
wordOpt.SetParaphformat(3);
wordOpt.SetFont(_T("隶书"),18);
wordOpt.WriteText(_T("测试"));
wordOpt.CreateBookMark(_T("书签2"));
wordOpt.WriteText(_T("("));
wordOpt.SetFont(_T("隶书"),18);
wordOpt.CreateHyperLink(_T("超链接2"),_T("书签1"));
wordOpt.WriteText(_T(")"));
wordOpt.NewLine();
wordOpt.SetFont(_T("黑体"),14);
wordOpt.WriteText(_T("——测试"));
wordOpt.NewLine();
wordOpt.SetParaphformat(2);
wordOpt.SetFont(_T("宋体"),10);
wordOpt.WriteText(_T("测试:2012/12/24-2012/12/31"));
wordOpt.NewLine();
wordOpt.SetParaphformat(1);
wordOpt.SetFont(_T("华文细黑"),12);
wordOpt.CreateTable(2,4);
wordOpt.SetTableFont(1,1,_T("华文细黑"),10);
wordOpt.WriteCellText(1,1,_T("测试"));
wordOpt.WriteCellText(1,2,_T("测试"));
wordOpt.WriteCellText(1,3,_T("测试"));
wordOpt.WriteCellText(1,4,_T("测试"));
wordOpt.WriteCellText(2,1,_T("测试"));
wordOpt.WriteCellText(2,2,_T("测试"));
wordOpt.WriteCellText(2,3,_T("测试"));
wordOpt.WriteCellText(2,4,_T("测试"));
wordOpt.SetTableShading(1,1,26367);
wordOpt.SetTableShading(2,1,26367);
wordOpt.SetTableShading(1,3,26367);
wordOpt.SetTableShading(2,3,26367);
wordOpt.EndLine();
CBitmap junk;
junk.LoadBitmapA(IDB_BITMAP1);
wordOpt.InsertShapes(&junk);
wordOpt.SaveAs(_T("D:\\doc1.doc"));
wordOpt.AppClose();
下面是结果图:
代码下载地址:http://download.csdn.net/detail/xiangjianbo127/5088353
CJG_WordApi wordOpt;
wordOpt.CreateAPP();
wordOpt.CreateDocument();
wordOpt.SetPageSetup();
wordOpt.SetParaphformat(3);
wordOpt.SetFont(_T("黑体"),28,/*26367*/13107230);
wordOpt.WriteText(_T("测试"));
wordOpt.NewLine();
wordOpt.SetFont(_T("华文细黑"),12);
wordOpt.CreateTable(3,5);
wordOpt.WriteCellText(1,1,_T("测试"));
wordOpt.WriteCellText(1,2,_T("测试"));
wordOpt.WriteCellText(1,3,_T("测试"));
wordOpt.WriteCellText(1,4,_T("测试"));
wordOpt.WriteCellText(1,5,_T("测试"));
wordOpt.SetTableShading(1,1,13107230);
wordOpt.SetTableShading(1,2,13107230);
wordOpt.SetTableShading(1,3,13107230);
wordOpt.SetTableShading(1,4,13107230);
wordOpt.SetTableShading(1,5,13107230);
wordOpt.WriteCellText(2,1,_T(""));
wordOpt.SetFont(_T("华文细黑"),12);
wordOpt.CreateBookMark(_T("书签1"));
wordOpt.CreateHyperLink(_T("超链接1"),_T("书签2"));
wordOpt.WriteCellText(2,2,_T("测试"));
wordOpt.WriteCellText(2,3,_T("测试"));
wordOpt.WriteCellText(2,4,_T("测试"));
wordOpt.WriteCellText(2,5,_T("测试"));
wordOpt.WriteCellText(3,1,_T("测试"));
wordOpt.WriteCellText(3,2,_T("测试"));
wordOpt.WriteCellText(3,3,_T("测试"));
wordOpt.WriteCellText(3,4,_T("测试"));
wordOpt.WriteCellText(3,5,_T("测试"));
wordOpt.EndLine();
wordOpt.NewLine(3);
//wordOpt.PageBreak();
wordOpt.SetParaphformat(3);
wordOpt.SetFont(_T("隶书"),18);
wordOpt.WriteText(_T("测试"));
wordOpt.CreateBookMark(_T("书签2"));
wordOpt.WriteText(_T("("));
wordOpt.SetFont(_T("隶书"),18);
wordOpt.CreateHyperLink(_T("超链接2"),_T("书签1"));
wordOpt.WriteText(_T(")"));
wordOpt.NewLine();
wordOpt.SetFont(_T("黑体"),14);
wordOpt.WriteText(_T("——测试"));
wordOpt.NewLine();
wordOpt.SetParaphformat(2);
wordOpt.SetFont(_T("宋体"),10);
wordOpt.WriteText(_T("测试:2012/12/24-2012/12/31"));
wordOpt.NewLine();
wordOpt.SetParaphformat(1);
wordOpt.SetFont(_T("华文细黑"),12);
wordOpt.CreateTable(2,4);
wordOpt.SetTableFont(1,1,_T("华文细黑"),10);
wordOpt.WriteCellText(1,1,_T("测试"));
wordOpt.WriteCellText(1,2,_T("测试"));
wordOpt.WriteCellText(1,3,_T("测试"));
wordOpt.WriteCellText(1,4,_T("测试"));
wordOpt.WriteCellText(2,1,_T("测试"));
wordOpt.WriteCellText(2,2,_T("测试"));
wordOpt.WriteCellText(2,3,_T("测试"));
wordOpt.WriteCellText(2,4,_T("测试"));
wordOpt.SetTableShading(1,1,26367);
wordOpt.SetTableShading(2,1,26367);
wordOpt.SetTableShading(1,3,26367);
wordOpt.SetTableShading(2,3,26367);
wordOpt.EndLine();
CBitmap junk;
junk.LoadBitmapA(IDB_BITMAP1);
wordOpt.InsertShapes(&junk);
wordOpt.SaveAs(_T("D:\\doc1.doc"));
wordOpt.AppClose();
下面是结果图:
代码下载地址:http://download.csdn.net/detail/xiangjianbo127/5088353
相关文章推荐
- MapReduce 配置、案例 WordCount 测试运行、如何提 交 Job、查看运行结果
- VS2010测试功能之旅:编码的UI测试(2)-操作“.NET研究”动作的录制原理(下)
- VS2010测试功能之旅:编码的UI测试(2)-操作动作的录制原理(下)
- 一起谈.NET技术,VS2010测试功能之旅:编码的UI测试(3)-操作对象的识别原理
- VS2010 操作Word(三)表格操作
- VS2010下FPU和SSE优化测试结果
- VS2010 操作Word(四)书签和超链接操作
- 一起谈.NET技术,VS2010测试功能之旅:编码的UI测试(2)-操作动作的录制原理(下)
- VS2010 操作Word(五)图片操作
- Word 2003文件保存和另存为操作是否熟练掌握的有关测试
- 单链表的各种操作(VS2010测试通过…
- VS2010 操作Word(六)属性设置
- 惨不忍睹!招聘考试-计算机操作水平测试结果分析
- VS2010测试功能之旅:编码的UI测试(2)-操作动作的录制原理(下)
- 收集的C#和Word操作的一些代码(本人未经测试)
- 收集的C#和Word操作的一些代码(本人未经测试)
- VS2010写WORD(二)表格操作
- VS2010 操作Word(二)基本操作
- “.NET研究”VS2010测试功能之旅:编码的UI测试(3)-操作对象的识别原理
- 对word2vec训练的model的结果操作笔记