久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開(kāi)始

搜索
查看: 4519|回復(fù): 0
收起左側(cè)

VC2010操作Word2010詳細(xì)資料

[復(fù)制鏈接]
ID:397085 發(fā)表于 2018-9-12 16:39 | 顯示全部樓層 |閱讀模式

環(huán)境:win7+vs2010+office2010/2013

  • 創(chuàng)建MFC工程,非Unicode
  • 添加Word的類庫(kù)

添加所有的接口,可以作為一個(gè)文件夾,以后再使用只要加入該文件夾就可以了。

由于函數(shù)命名沖突,需要在生成的頭文件中做相應(yīng)處理,即:

//#import "C:\\Program Files\\Microsoft Office\\Office14\\MSWORD.OLB" no_namespace

#import "C:\\Program Files\\Microsoft Office\\Office14\\MSWORD.OLB" no_namespace\

              raw_interfaces_only \

              rename("FindText", "_FindText") \

              rename("Rectangle", "_Rectangle") \

              rename("ExitWindows", "_ExitWindows")

對(duì)于不同版本的office,其默認(rèn)的類型庫(kù)位置如下表所示:

Office 版本

路徑

Office 2003

C:\Program Files\Microsoft Office\Office11

Office 2007

C:\Program Files\Microsoft Office\Office12

Office 2010

C:\Program Files\Microsoft Office\Office14

Office 2013

C:\Program Files\Microsoft Office\Office15


特別的,word2013在vc2010下必須手動(dòng)指定類型庫(kù)文件位置。

3、在stdafx中添加調(diào)用的頭文件

#include "Word2010/CApplication.h"              // word程序?qū)ο?/font>

#include "Word2010/CDocuments.h"              // 文檔集對(duì)象

#include "Word2010/CDocument0.h"              // 單個(gè)docx對(duì)象

#include "Word2010/CSelection.h"              // 該對(duì)象代表窗口或窗格中的當(dāng)前所選內(nèi)容,使用率最高

#include "Word2010/CCell.h"              // 表格單元格

#include "Word2010/CCells.h"              // 表格單元格集合

#include "Word2010/CRange.h"              // 該對(duì)象代表文檔中的一個(gè)連續(xù)范圍

#include "Word2010/CTable0.h"              // 單個(gè)表格

#include "Word2010/CTables0.h"              // 表格集合

#include "Word2010/CFont0.h"              // 字體

#include "Word2010/CParagraphs.h"              // 段落集合

#include "Word2010/CParagraphFormat.h"              // 段落樣式

#include "Word2010/CParagraph.h"              // 單個(gè)段落

#include "Word2010/CnlineShape.h"              // Inline圖形對(duì)象集合

#include "Word2010/CnlineShapes.h"              // 單個(gè)Inline圖像對(duì)象

#include "Word2010/CRow.h"              // 單個(gè)行

#include "Word2010/CRows.h"              // 行集合

#include "Word2010/CFields.h"

#include "Word2010/CPane0.h"              // 頁(yè)眉等設(shè)置

#include "Word2010/CWindow0.h"// 頁(yè)眉等設(shè)置

#include "Word2010/CView0.h"// 頁(yè)眉等設(shè)置

#include "Word2010/CPageSetup.h"              // 頁(yè)面設(shè)置

4、注銷每個(gè)引入的頭文件的import行

//#import "C:\\Program Files\\Microsoft Office\\Office14\\MSWORD.OLB" no_namespace

不過(guò)如果使用wdMove等參數(shù)的話,只需要在CApplication.h文件中改為:

//#import "C:\\Program Files\\Microsoft Office\\Office14\\MSWORD.OLB" no_namespace

#import "C:\\Program Files\\Microsoft Office\\Office14\\MSWORD.OLB" no_namespace\

              raw_interfaces_only \

              rename("FindText", "_FindText") \

              rename("Rectangle", "_Rectangle") \

              rename("ExitWindows", "_ExitWindows")

否則,如果沒(méi)有上面一段,則報(bào)錯(cuò)提示為(即全部頭文件都注銷import的情況下):

但是上述的方法會(huì)帶來(lái)一個(gè)問(wèn)題,就是當(dāng)word版本改變時(shí)會(huì)出現(xiàn)問(wèn)題,解決辦法就是上述報(bào)錯(cuò)的變量都用其數(shù)值代替就不會(huì)有問(wèn)題了(寫(xiě)代碼時(shí)可以加上用以查看wdMove等變量的值),如下面一些:

wdAlignParagraphLeft = 0

wdAlignParagraphCenter = 1

wdAlignParagraphRight = 2

wdAlignParagraphJustify = 3

wdParagraph = 4

wdMove = 0

wdStyleHeading1 = -2

wdStory = 6

頁(yè)面縱向wdOrientPortrait=0

頁(yè)面橫向wdOrientLandscape=1

enum WdUnits

{

    wdCharacter = 1, // 字母

    wdWord = 2, // 單詞

    wdSentence = 3, // 句子

    wdParagraph = 4, // 段落

    wdLine = 5, // 行

    wdStory = 6, // 所選區(qū)域

    wdScreen = 7, // 當(dāng)前屏幕

    wdSection = 8, // 部分

    wdColumn = 9, // 列

    wdRow = 10, // 行

    wdWindow = 11, // 窗口

    wdCell = 12, // 單元格

    wdCharacterFormatting = 13, // 字體格式

    wdParagraphFormatting = 14, // 段落格式

    wdTable = 15, // 表格

    wdItem = 16 // 項(xiàng)目

};

具體可以參考手冊(cè)或者通過(guò)VBA代碼查看。

5、到CXXXApp.cpp文件中找到InitInstance函數(shù)

添加代碼:

              // 例如修改為公司或組織名

              SetRegistryKey(_T("應(yīng)用程序向?qū)傻谋镜貞?yīng)用程序"));

              if ( !AfxOleInit() )

              {

                            AfxMessageBox(_T("無(wú)法初始化COM的動(dòng)態(tài)鏈接庫(kù)!"));

                            return FALSE;

              }

這一步可以通過(guò)在創(chuàng)建MFC工程時(shí),勾選“自動(dòng)化”。

6、具體代碼

添加按鈕,在按鈕中實(shí)現(xiàn):

void CVCForWordDlg::OnBnClickedButton1()

{

              // TODO: 在此添加控件通知處理程序代碼

              COleVariant              covZero((short)0),

                            covTrue((short)TRUE),

                            covFalse((short)FALSE),

                            covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR),

                            covDocxType((short)0);

            

              // 定義word變量

              CApplication wordApp; // wordApp

              CDocuments docxs; // docxs

              CDocument0 docx, docx_active; // docx

              if ( !wordApp.CreateDispatch(_T("Word.Application")) ) // 實(shí)例化wordApp,必須有初始化

              {

                            AfxMessageBox(_T("本機(jī)沒(méi)有安裝word產(chǎn)品!"));

                            return;

              }

              else

              {

                            wordApp.put_Visible(FALSE);  // 設(shè)置文檔開(kāi)始不可見(jiàn)

                            CString wordVersion = wordApp.get_Version();              // 獲得當(dāng)前word的版本,比如word2010為14.0,2013為15.0

                            // ****************** 添加一個(gè)document ******************

                            // 得到docxs

                            docxs = wordApp.get_Documents();              // 或者下面一段

                            // =====================================

                            //LPDISPATCH disp = wordApp.get_Documents();

                            //if ( NULL == disp )

                            //              return;// FALSE;

                            //docxs.AttachDispatch(disp);

                            //if ( NULL == docxs.m_lpDispatch )

                            //              return;// FALSE;

                            // =====================================

                            // 添加一個(gè)docx

                            docx = docxs.Add(covOptional, covOptional, covOptional, covOptional);              // 未用模板時(shí),或者下面段兩種

                            // =====================================

                            // 2,未用模板

                            //docx.AttachDispatch(docxs.Add(covOptional, covOptional, covOptional, covOptional));

                            // 3,使用模板

                            //CComVariant tpl(_T("")), Visble, DocxType(0), NewTemplate(false);

                            //docx = docxs.Add(&tpl,&NewTemplate,&DocxType,&Visble);

                            // =====================================

                            if ( NULL == docx.m_lpDispatch )

                                          return;

                            // ****************** 設(shè)置頁(yè)邊距 ******************

                            // 放在創(chuàng)建文檔后,需要CPageSetup.h

                            docx_active = wordApp.get_ActiveDocument();

                            CPageSetup oPageSetup = docx_active.get_PageSetup();

                            // 設(shè)置為頁(yè)面方向和頁(yè)邊距

                            if ( oPageSetup.get_Orientation() == 0 )              // 若為縱向則設(shè)置為橫向,縱向wdOrientPortrait=0,橫向wdOrientLandscape=1

                            {

                                          oPageSetup.put_Orientation(1);              // 橫向

                                          // 設(shè)置上下左右變距,單位緹,以下參數(shù)設(shè)置的頁(yè)邊距是“適中”

                                          oPageSetup.put_TopMargin( (float) 72);              // 適中時(shí)72=2.54cm,默認(rèn)時(shí)90=3.17cm;10≈0.35cm

                                          oPageSetup.put_BottomMargin( (float) 72);              // 適中時(shí)72=2.54cm,默認(rèn)時(shí)90=3.17cm;10≈0.35cm

                                          oPageSetup.put_LeftMargin( (float) 54);              // 適中時(shí)54=1.9cm,默認(rèn)時(shí)72=2.54cm

                                          oPageSetup.put_RightMargin( (float) 54);              // 適中時(shí)54=1.9cm,默認(rèn)時(shí)72=2.54cm

                            }

                            //else              // 設(shè)置為縱向

                            //{

                            //              oPageSetup.put_Orientation(0);

                            //              // 設(shè)置上下左右變距,單位緹,以下參數(shù)設(shè)置的頁(yè)邊距是“適中”

                            //              oPageSetup.put_TopMargin( (float) 72);              // 適中時(shí)72=2.54cm,默認(rèn)或普通時(shí)72=2.54cm;10≈0.35cm

                            //              oPageSetup.put_BottomMargin( (float) 72);              // 適中時(shí)72=2.54cm,默認(rèn)或普通時(shí)72=2.54cm;10≈0.35cm

                            //              oPageSetup.put_LeftMargin( (float) 54);              // 適中時(shí)54=1.9cm,默認(rèn)或普通時(shí)90=3.17cm

                            //              oPageSetup.put_RightMargin( (float) 54);              // 適中時(shí)54=1.9cm,默認(rèn)或普通時(shí)90=3.17cm

                            //}

                            // 聲明一個(gè)CSelection對(duì)象,并實(shí)例化

                            CSelection wordSelection = wordApp.get_Selection();

                            // ****************** 設(shè)置文檔內(nèi)容 ******************

                            wordSelection.TypeText(_T("虛擬試驗(yàn)仿真報(bào)表"));

                            wordSelection.HomeKey(COleVariant((short)5), COleVariant((short)1)); // wdLine=5,返回當(dāng)前行首,并選擇當(dāng)前行

                            wordSelection.put_Style( COleVariant((short)-2) );// 設(shè)置為“標(biāo)題1“樣式,wdStyleHeading1=-2

                            // 設(shè)置選擇區(qū)域字體,一定要放在樣式后,否則格式會(huì)被樣式的覆蓋

                            CFont0 font = wordSelection.get_Font();

                            font.put_Name(_T("微軟雅黑"));

                            font.put_Size(16);              // 必須選擇該行才可以修改,即必須有HomeKey那行

                            // 獲得當(dāng)前段落,并設(shè)置對(duì)齊方式

                            CParagraph lastPara = GetCurParagraph(docx);

                            lastPara.put_Alignment(1);              // wdAlignParagraphLeft=0, wdAlignParagraphCenter=1,wdAlignParagraphRight=2

                            // 結(jié)束當(dāng)前段落編輯,移動(dòng)光標(biāo)到段落后

                            wordSelection.EndOf(COleVariant((short)4), COleVariant((short)0));              // wdParagraph=4,wdMove=0

                            wordSelection.TypeParagraph(); // 新起一段

                            COleVariant covTime(_T("yyyy-MM-dd:dddd"));              // 時(shí)間格式可調(diào)整

                            wordSelection.InsertDateTime(covTime, covFalse, covOptional, covOptional, covOptional);              // 插入當(dāng)前時(shí)間

                            wordSelection.EndOf(COleVariant((short)4), COleVariant((short)0));              //結(jié)束當(dāng)前段落編輯,wdParagraph=4,wdMove=0

                            // 生成表格

                            MakeRTITable( docx, wordSelection );

                            // 以下為為不同段落設(shè)置不同字體和對(duì)齊方式示例

                            wordSelection.TypeParagraph(); // 新起一段

                            wordSelection.TypeText(_T("end of the story!"));

                            wordSelection.HomeKey(COleVariant((short)5), COleVariant((short)1)); // wdLine=5,返回當(dāng)前行首,并選擇當(dāng)前行

                            /*CFont0 */font = wordSelection.get_Font();

                            font.put_Size(20);              // 必須選擇該行才可以修改,即必須有HomeKey那行

                            /*CParagraph */lastPara = GetCurParagraph(docx);

                            lastPara.put_Alignment(3);              // 右對(duì)齊

                            wordSelection.EndOf(COleVariant((short)4), COleVariant((short)0));              //結(jié)束當(dāng)前段落編輯,wdParagraph=4,wdMove=0

                            wordSelection.TypeParagraph(); // 新起一段

                            wordSelection.TypeText(_T("Thanks for reading!"));

                            wordSelection.HomeKey(COleVariant((short)5), COleVariant((short)1)); // wdLine=5,返回當(dāng)前行首,并選擇當(dāng)前行

                            /*CFont0 */font = wordSelection.get_Font();

                            font.put_Size(10);              // 必須選擇該行才可以修改,即必須有HomeKey那行

                            font.put_Name(_T("Times New Roman"));

                            /*CParagraph */lastPara = GetCurParagraph(docx);

                            lastPara.put_Alignment(1);              // 居中對(duì)齊

                            wordSelection.EndOf(COleVariant((short)4), COleVariant((short)0));              //結(jié)束當(dāng)前段落編輯,wdParagraph=4,wdMove=0

                            // 插入分頁(yè)符,用于換頁(yè)

                            wordSelection.InsertBreak(covOptional);

                           

                            // 插入公式,操作域

                            CFields fields = wordSelection.get_Fields();

                            COleVariant ofont = _variant_t(_T("Times New Roman"));

                            COleVariant text = _variant_t(_T("EQ \\a \\ar \\co2 \\vs3 \\hs3(Axy,Bxy,A,B)"));              // 注意要兩個(gè)\\,一個(gè)轉(zhuǎn)義后不對(duì)!!!

                            fields.Add( wordSelection.get_Range(), covOptional, text, covFalse );

                            wordSelection.HomeKey(COleVariant((short)5), COleVariant((short)1)); // wdLine=5,返回當(dāng)前行首,并選擇當(dāng)前行

                            lastPara = GetCurParagraph(docx);

                            lastPara.put_Alignment(0);              // 左對(duì)齊

                            wordSelection.EndOf(COleVariant((short)4), COleVariant((short)0));              //結(jié)束當(dāng)前段落編輯,wdParagraph=4,wdMove=0

                            // 獲取應(yīng)用當(dāng)前Debug路徑

                            char fileName[MAX_PATH];

                            GetModuleFileName(NULL, fileName, MAX_PATH);

                            char dir[260];

                            char dirver[100];

                            _splitpath(fileName, dirver, dir, NULL, NULL);

                            CString strAppPath = dirver;

                            strAppPath += dir;

                            //CString strAppPath = _T("D:\\");

                            // ****************** 插入圖片示例 ******************

                            // 需要CWindow0.h, CPane0.h, CView0.h

                            wordSelection.TypeParagraph();              // 另起一段

                            CString strPicture = strAppPath + _T("\\截圖.jpg");

                            CnlineShapes nLineShapes = wordSelection.get_InlineShapes();

                            CnlineShape nLineshape = nLineShapes.AddPicture(strPicture, covFalse, covTrue, covOptional);

                            // ****************** 設(shè)置頁(yè)眉頁(yè)腳 ******************

                            CWindow0 oWind = docx.get_ActiveWindow();

                            CPane0 oPane = oWind.get_ActivePane();              // 一定將CPane改為CPane0或其他

                            CView0 oView = oPane.get_View();

                            // =============== 設(shè)置頁(yè)眉 ===============

                            oView.put_SeekView(9);              // wdSeekCurrentPageHeader=9

                            /*CFont0 */font = wordSelection.get_Font();              // 設(shè)置選擇區(qū)域字體

                            font.put_Name(_T("華文楷體"));

                            font.put_Size(16);

                            /*CParagraphFormat */lastPara = wordSelection.get_ParagraphFormat();              // 默認(rèn)為居中

                            lastPara.put_Alignment(1);              // wdAlignParagraphLeft=0, wdAlignParagraphCenter=1, wdAlignParagraphRight=2

                            wordSelection.TypeText(_T("網(wǎng)絡(luò)大學(xué)"));

                            // =============== 設(shè)置頁(yè)腳,包括頁(yè)碼 ===============

                            oView.put_SeekView(10);              // wdSeekCurrentPageFooter=10

                            /*CFont0 */font = wordSelection.get_Font();              // 設(shè)置選擇區(qū)域字體,一定要放在樣式后,否則格式會(huì)被樣式的覆蓋

                            font.put_Name(_T("華文楷體"));

                            font.put_Size(16);

                            /*CParagraphFormat */lastPara = wordSelection.get_ParagraphFormat();              // 默認(rèn)為居中

                            lastPara.put_Alignment(1);              // wdAlignParagraphLeft=0, wdAlignParagraphCenter=1, wdAlignParagraphRight=2

                            // 添加頁(yè)碼

                            wordSelection.TypeText(_T("第頁(yè) 共頁(yè)"));

                            wordSelection.MoveLeft( COleVariant((short)1), COleVariant((short)4), &covZero );

                            /*CFields */fields = wordSelection.get_Fields();

                            fields.Add( wordSelection.get_Range(), COleVariant((short)33), COleVariant("PAGE  "), &covTrue );              // 增加頁(yè)碼域,當(dāng)前頁(yè)碼

                            wordSelection.MoveRight( COleVariant((short)1), COleVariant((short)3), &covZero);

                            fields.Add( wordSelection.get_Range(), COleVariant((short)26), COleVariant("NUMPAGES  "), &covTrue );              // 增加頁(yè)碼域,總頁(yè)數(shù)

                            oView.put_SeekView(0);              // 關(guān)閉頁(yè)眉頁(yè)腳,wdSeekMainDocument=0,回到主控文檔

                            // Word程序可見(jiàn),顯示報(bào)表

                            //wordApp.put_Visible(TRUE);

                            // 保存成果

                            CString strSavePath = strAppPath;

                            strSavePath += _T("\\報(bào)表.docx");

                            docx.SaveAs(COleVariant(strSavePath), covOptional, covOptional, covOptional, covOptional,

                                          covOptional, covOptional, covOptional, covOptional, covOptional, covOptional, covOptional, covOptional, covOptional, covOptional,covOptional);

                            // 退出word應(yīng)用

                            docx.Close(covFalse, covOptional, covOptional);

                            wordApp.Quit(covOptional, covOptional, covOptional);

                            wordApp.ReleaseDispatch();

                            MessageBox(_T("生成成功!"));

              }            

}

表格插入函數(shù)MakeRTITable(CDocument0& oDoc, CSelection& selection):

void CVCForWordDlg::MakeRTITable(CDocument0& oDoc, CSelection& selection)

{

              int nRowSize = 10;

              nRowSize = nRowSize == 0 ? 2 : nRowSize;              // 表格至少兩行

              // new paragraph

              selection.TypeParagraph();              // 新起一段

              // Add table title

              selection.TypeParagraph();              // 新起一段

              selection.TypeText(RTITableTitle);

              CParagraph lastPara = GetCurParagraph(oDoc);

              //lastPara.put_Alignment(wdAlignParagraphCenter);              // 下面表格內(nèi)容也受此控制

              //selection.EndOf(COleVariant((short)wdParagraph), COleVariant((short)wdMove));

              lastPara.put_Alignment(1);              // 下面表格內(nèi)容也受此控制

              selection.EndOf(COleVariant((short)4), COleVariant((short)0));

              // Add table

              CTables0 wordTables = oDoc.get_Tables();

              CRange wordRange = selection.get_Range();

              COleVariant covTrue((short)TRUE), covFalse((short)FALSE), covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);

              CTable0 wordTable = wordTables.Add(wordRange, nRowSize , RTITableColumnSize, covTrue, covFalse); // 添加表格

              wordRange = wordTable.get_Range();

              // Make header

              CCell cell;

              for ( int i=1; i<RTITableColumnSize+1; i++ )

              {

                            cell = wordTable.Cell(1, i); // 表格第一行第i列單元格

                            cell.Select();

                            selection.TypeText(RTITableFieldArray[i-1]);

              }

              //selection.EndOf(COleVariant((short)wdStory), COleVariant((short)wdMove)); // 結(jié)束表格編輯

              selection.EndOf(COleVariant((short)6), COleVariant((short)0)); // 結(jié)束表格編輯

              for ( int i=1; i<RTITableColumnSize+1; i++ )

              {

                            cell = wordTable.Cell(2, i); // 表格第一行第i列單元格

                            cell.Select();

                            selection.TypeText(_T("111.0"));

              }

              //selection.EndOf(COleVariant((short)wdStory), COleVariant((short)wdMove)); // 結(jié)束表格編輯

              selection.EndOf(COleVariant((short)6), COleVariant((short)0)); // 結(jié)束表格編輯

              // 合并單元格,需要注意的是,合并整行前不能有單元格的合并,否則無(wú)法獲取表格的行信息

              CRows rows;

              rows = wordTable.get_Rows();              // 獲取表格的行

              CRow row;

              row = rows.Item(3);              // 指向第三行

              wordRange = row.get_Range();

              CCells cells;

              cells = wordRange.get_Cells();              // 得到該行所有單元格

              cells.Merge();              // 合并第三行為一列

              cell = wordTable.Cell( 4, 1 );

              cell.Merge( wordTable.Cell( 5, 1 ) );              //合并第一列中的第四行與第五行

              // 光標(biāo)的移動(dòng)方式.通過(guò)Selection類對(duì)象的方法對(duì)光標(biāo)進(jìn)行上下,左右等移動(dòng),實(shí)現(xiàn)對(duì)光標(biāo)的定位功能

              selection.MoveRight( COleVariant((short)1), COleVariant((short)1), COleVariant((short)0) );              // 向右移動(dòng)鼠標(biāo)到下一個(gè)字符

              selection.MoveDown( COleVariant((short)5), covOptional, covOptional );              // 向下移動(dòng)鼠標(biāo)到下一行

              COleVariant vUnit((short)RTITableColumnSize);              // 光標(biāo)移動(dòng)方式為行            

              COleVariant vCount((short)3);

              selection.Move( &vUnit, &vCount );              // 移動(dòng)3行

              cells.Merge();              // 合并第三行為一列

              COleVariant vEnd((short)5);

              selection.EndKey( &vEnd, &covOptional );              // 將光標(biāo)移動(dòng)到行尾

}

自定義函數(shù)GetCurParagraph(CDocument0& curDoc):

CParagraph CVCForWordDlg::GetCurParagraph(CDocument0& curDoc)

{

              CParagraphs paragraphs = curDoc.get_Paragraphs();

              CParagraph lastPara = paragraphs.get_Last();

              return lastPara;

}

7、生成文檔結(jié)果

8、說(shuō)明

(1)關(guān)于設(shè)置頁(yè)邊距時(shí)的參數(shù)說(shuō)明

以緹為單位,一個(gè)與屏幕無(wú)關(guān)的單位,用來(lái)保證屏幕應(yīng)用程序?qū)ζ聊辉氐亩ㄎ缓捅壤谒械娘@示系統(tǒng)上的一致性。一緹等價(jià)于 1/20 個(gè)打印機(jī)的磅。一邏輯英寸大約有 1440 緹,一邏輯厘米約 567 緹(打印時(shí)的一英寸或一厘米所對(duì)應(yīng)的屏幕上的長(zhǎng)度)。

但實(shí)際word文檔中顯示和打印效果來(lái)看,56.7緹=2cm,10緹=0.35cm。

(2)加載CPane.h文件前,將CPane改為CPane0,否則會(huì)出現(xiàn)重定義,還有一個(gè)afxpane.h中有CPane類

(3)生成的word文檔,如果頁(yè)碼顯示和公式顯示為代碼形式,一個(gè)可以直接全選右鍵“切換域代碼”,對(duì)于頁(yè)碼則選中頁(yè)腳同樣操作即可;另一個(gè)可以設(shè)置word文檔的格式,在文件——選項(xiàng)——高級(jí)中去掉“顯示域代碼而非域值”前面的勾即可。

(4)設(shè)置頁(yè)邊距和頁(yè)面方向的時(shí)候,還是在創(chuàng)建文檔后設(shè)置,否則在后面設(shè)置時(shí)可以會(huì)有一些問(wèn)題。

(5)通過(guò)域代碼來(lái)寫(xiě)簡(jiǎn)單公式,域代碼格式可以參考網(wǎng)頁(yè):

http://blog.sina.com.cn/s/blog_6967a9d30100mrbx.html

其他相關(guān)內(nèi)容,百度或谷歌,網(wǎng)上挺多的。

VC 2010操作Word2010.docx

244.56 KB, 下載次數(shù): 3, 下載積分: 黑幣 -5

回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表
主站蜘蛛池模板: 亚洲一区在线看 | 国内精品偷拍 | 91爱爱网| 国产高清91| 精品国产99久久久久久宅男i | www.日本在线观看 | 男人操女人的网站 | 久久日韩精品 | 亚洲在线视频 | 国产三级黄色片 | 色伊伊 | 老司机午夜视频 | 久久99深爱久久99精品 | 欧美日韩不卡 | 国产精品一区二 | 精品一区三区 | 91精品久久久久 | 国产福利在线播放 | 亚洲精品免费观看 | 欧美激情小视频 | 日本精品国产 | 中文字幕一区在线观看 | 国产高清一区二区三区 | 9999精品视频 | 日本欧美在线 | 日本国产精品 | 国产中文字幕在线观看 | 91网在线 | 久久久久国产视频 | 人人干人人爽 | 黄在线免费观看 | 国产黄色在线观看 | 99热国产在线 | 日韩欧美中文字幕在线观看 | 五月天激情国产综合婷婷婷 | 私人午夜影院 | 双性呜呜宫交受不住了h | av不卡在线播放 | 中文字字幕码一二三区 | 一级免费片 | 中文字幕在线观看不卡 |