C 定位Word文件中的某個位置插入文字

2021-09-05 23:37:13 字數 533 閱讀 2978

利用書籤定位到word文件的指定位置 (三種方法)

首先在word文件中,設定書籤,並命名(假設建了乙個名為"bm_test"的書籤)

然後使用c#操作word

using msword = microsoft.office.interop.word;

object bk = "bm_test";

方法二:使用word文件變數

if (worddoc.bookmarks.exists("bm_test"))

方法三:使用goto函式,跳轉到指定書籤

object bookmarkname = "bm_test";

object what = msword.wdgotoitem.wdgotobookmark;

worddoc.activewindow.selection.goto(ref what, ref nothing, ref nothing, ref bookmarkname);

worddoc.activewindow.selection.typetext("hello!");

JS控制游標定位,定位到文字的某個位置

這是乙個數字密碼,要能夠智慧型的跳轉到文字的某個位置,就需要通過js來控制跳轉!class put id number password input type tel maxlength 12 tabindex 6 onkeyup dealkeyup this 游標定位 function dealk...

JS控制游標定位,定位到文字的某個位置

這是乙個數字密碼,要能夠智慧型的跳轉到文字的某個位置,就需要通過js來控制跳轉!class put id number password input type tel maxlength 12 tabindex 6 onkeyup dealkeyup this 游標定位 function dealk...

C 中操作Word文件

今天,在用c 語言開發乙個word報表,在網上看到一些有用的文章,先 過來,自己屯著。以下來自 參考 http xb.hzu.edu.cn qikan manage wenzhang 200906014.pdf 在當前專案開發過程中,客戶有根據資料庫資料生成word文件的需求,在和 同事溝通的過程中...