C richtextbox讀取,C richtextbox 讀取word

時間 2021-05-02 22:13:16

1樓:匿名使用者

方法如下:

新建乙個winform工程,新增兩個button控制項和乙個textbox控制項。

新增引用com檔案microsoft word 11.0 object library。

並在**中新增命名空間using word //注意首字母大寫。

定義全域性變數

//建立word

//建立word文件

_document doc=null;

注意word和word文件是不同的。

讀取word文件

string temp = doc.paragraphs[i].range.text.trim();//變數i為第i段

textbox1.text = temp; //將第i段內容複製到textbox中。

2樓:匿名使用者

richtextbox1.loadfile(@"c:\users\yy\desktop\雜七雜八\gf優秀個人.

doc", richtextboxstreamtype.richtext);

不明白加qq624357262

c 怎麼讀取處理檔案,C 怎麼讀取處理txt檔案

影者東昇 include include 為了使用exit int main file fp char fname 50 用於存放檔名printf 輸入檔名 scanf s fname fp fopen fname,r 只供讀取if fp null 如果失敗了 while fgets line,si...

js讀取Cookies,怎麼在js中讀取cookies

茂煙 簡單讀取 var the cookie document.cookie var broken cookies the cookie.split var the first broken cookies 0 var the name the first.split 0 var the value...

C關於檔案讀取的問題,C 關於乙個檔案讀取的問題

filestream fs3 new filestream of.filename,filemode.open 讀入乙個檔案 byte send new byte fs3.length 2 byte send1 new byte fs3.length 2 建立兩個位元組陣列,準備分別讀入 fs3.r...