導航:首頁 > 文件教程 > 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相關的資料

熱點內容
書生版本庫 瀏覽:433
app利率走勢哪裡看 瀏覽:743
怎麼盜取微信密碼軟體 瀏覽:445
vssdf文件是什麼 瀏覽:216
怎麼看網路約談視頻 瀏覽:571
qq瀏覽器會分享wifi嗎 瀏覽:120
zip文件分成3個 瀏覽:261
txt的文件1m是多少個字 瀏覽:642
易班下載文件在哪裡 瀏覽:175
怎麼獲得有效電腦網路ip地址 瀏覽:471
怎麼解決網站痛點 瀏覽:800
iphone4ios71降級613 瀏覽:650
garageband升級 瀏覽:689
科學linux 瀏覽:447
哪裡的app理財好 瀏覽:799
linux下線程的創建線程數 瀏覽:804
怎麼改變文件大小 瀏覽:574
飛雪流水軟體注冊破解工具 瀏覽:814
csgo比賽數據哪裡看 瀏覽:961
已越獄iphone4升級ios7 瀏覽:607

友情鏈接