VBA word中插入文字和藝術字

2021-08-07 19:48:56 字數 884 閱讀 3265

在當前游標處(活動文件末尾)插入文字

sub inserttextatendofdocument()

activedocument.content.insertafter text:=" the end."

endsub

在所選內容前插入文字:

sub addtextbeforeselection()

selection.insertbefore text:="new text "

endsub

由於文字不容易選擇位置,不好在頁面中固定位置,所以此時藝術字變成了非常好的代替方案。

sub texteffect()

dim arr as

integer

arr = 50

activedocument.shapes.addtexteffect(msotexteffect1, str(arr), "times new roman", 20, msotrue, msofalse, 100, 100).select

activedocument.shapes.addtexteffect(msotexteffect1, "hahaha", "times new roman", 20, msotrue, msofalse, 150, 150).select

endsub

addtexteffect裡面的引數按順序分別是:

藝術字樣式,內容,字型,大小,是否粗體,是否斜體,最左邊位置,最上邊位置

執行效果圖:

Android 文字中插入表情

這段時間在做乙個簡訊專案,需要實現簡訊中插入表情的功能,本一位非常困難,經過一段時間的研究,發現還是比較簡単的,現在總結如下。首先需要構建乙個imagegetter,作用是通過html標記獲得對應在res目錄下的 imagegetter imagegetter new imagegetter 然後就...

js設定游標插入文字和HTML

在乙個textarea的某個游標位置插入文字或者在某個編輯器中插入html內容,我最近經常和這些打交道,但總是一團模糊,今天整理一下關於如何插入文字,設定游標,移動游標等操作。一 在textarea某個位置插入文字 function insertatcursor myfield,myvalue mo...

jQuery 文字插入和標籤移動方法

doctype html html lang en head meta charset utf 8 title title title script src jquery 3.2.1.js script head body div id div1 hello div1 div p id p1 hel...