導航:首頁 > 文件教程 > wordrangetable

wordrangetable

發布時間:2024-04-25 22:33:56

1. word VBA 的主要對象體系結構是怎樣的編輯中常用對象有哪些

Word VBA 中的對象庫比較龐大,建議使用時通過聯機的開發人員幫助文檔來獲取相關對象的體系結構(對象、成員、屬性、方法):

Application、document、word、range、Row對象是常用的對象

2. 用VBA批量處理word 中的表格:將表格內容調整為上下,左右居中,表格設置為根據窗口調整表格

你把
For Each oTable In oDoc.Tables
oTable.Range.Font.Name = "黑體" ' 改變表格字體為「黑體」
oTable.Range.Font.Size = 10.5 ' 改變表格字型大小為12磅
Next
改為:
For Each oTable In oDoc.Tables
oTable.AutoFitBehavior (wdAutoFitWindow) '根據窗口調整內容
oTable.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter '水平居中
oTable.Range.Cells.VerticalAlignment = wdCellAlignVerticalCenter '垂直居中
Next

3. 一個很大的Word文檔中,裡面文字、多個表格並存。如何通過宏的編輯,一次性選中所有的表格

Sub SelectAllTables()
Dim tempTable As Table

Application.ScreenUpdating = False

'判斷文檔是否被保護
If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then
MsgBox "文檔已保護,此時不能選中多個表格!"
Exit Sub
End If
'刪除所有可編輯的區域
ActiveDocument.DeleteAllEditableRanges wdEditorEveryone
'添加可編輯區域
For Each tempTable In ActiveDocument.Tables
tempTable.Range.Editors.Add wdEditorEveryone
Next
'選中所有可編輯區域
ActiveDocument.SelectAllEditableRanges wdEditorEveryone
'刪除所有可編輯的區域
ActiveDocument.DeleteAllEditableRanges wdEditorEveryone

Application.ScreenUpdating = True

End Sub

閱讀全文

與wordrangetable相關的資料

熱點內容
有什麼好看的地圖網站 瀏覽:593
oppo如何設置app黑名單 瀏覽:71
移動數據用了多少在哪裡顯示 瀏覽:549
excel表改變文件名顏色的方法 瀏覽:966
linuxshell二進制文件 瀏覽:36
什麼是網路道德問題產生的 瀏覽:836
c清除文件夾 瀏覽:407
租房貸款用什麼app 瀏覽:59
虛擬機oracle安裝教程 瀏覽:745
太原編程班哪裡有 瀏覽:544
壓縮文件怎麼找 瀏覽:586
wwwjshousecomcn 瀏覽:648
U盤文件路徑在哪 瀏覽:502
不記得路由器密碼怎麼辦 瀏覽:118
wps的ppt怎麼轉pdf文件怎麼打開 瀏覽:396
excel怎麼大批量提取數據 瀏覽:732
linux修改文件為當前時間 瀏覽:829
怎麼寫html文件路徑 瀏覽:982
空電路板怎麼寫入程序 瀏覽:292
cad文件選項卡鎖定 瀏覽:63

友情鏈接