VBA如何选中Word文档中的文本.表格
时间:2023-12-13 05:06:20
Select方法可用于多种对象,例如Bookmark、Field、Range 和Table对象。
A:下列示例选定活动文档中的第一个表格
Sub SelectTable()
ActiveDocument.Tables(1).Select
End Sub
B:下列示例选定活动文档中的第一个域
Sub SelectField()
ActiveDocument.Fields(1).Select
End Sub
C:下列示例选定活动文档中的前四个段落
Range方法用于创建一个引用前四个段落的 Range对象,然后将 Select方法应用于 Range对象。
Sub SelectRange()
Dim rngParagraphs As Range
Set rngParagraphs = ActiveDocument.Range( Start:=ActiveDocument.Paragraphs(1).Range.Start, End:=ActiveDocument.Paragraphs(4).Range.End)
rngParagraphs.Select
End Sub
D:下列命令选定活动文档中的第一个单词
Sub SelectFirstWord()
ActiveDocument.Words(1).Select
End Sub
标签:VBA如何选中Word文档中的文本.表格
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Win11硬件加速怎么开启?Win11开启硬件加速方法
2023-01-30 12:26:09
![](https://img.aspxhome.com/file/2023/1/a283578_0s.png)
windows7系统自动备份设置方法图文教程
2022-03-29 17:31:10
![](https://img.aspxhome.com/file/2023/29/a257298_0s.jpg)
coloros全面屏手势如何设置-coloros11全面屏手势设置教程
2023-12-18 06:25:03
![](https://img.aspxhome.com/file/2023/3/a293144_0s.jpg)
wps文字怎么给文本框添加阴影效果教程
2022-11-28 03:04:20
edge浏览器怎么更新_edge浏览器更新方法
2023-08-02 05:46:35
![](https://img.aspxhome.com/file/2023/2/a284862_0s.jpg)
如何在Excel 2013/2016中使用的VBA宏来根据下拉列表选项来隐藏或取消隐藏特定列
2023-09-01 16:42:05
![](https://img.aspxhome.com/file/2023/9/a141299_0s.png)
现在内存多少钱一根?知道真相眼泪掉下来
2023-03-09 21:55:59
![](https://img.aspxhome.com/file/2023/3/a298271_0s.jpg)
在Word 2019中升级和降级标题?
2023-10-24 14:11:10
iOS 12 beta 3 更新了什么内容? iOS 12 beta 3 值得更新吗?
2022-08-17 17:49:26
![](https://img.aspxhome.com/file/2023/2/a199992_0s.jpg)
ps怎么剪裁掉不想要的部分
2022-06-22 16:37:54
![](https://img.aspxhome.com/file/2023/9/a342743_0s.png)
Win10如何安装?Win10安装教程
2022-05-31 00:57:58
![](https://img.aspxhome.com/file/2023/26/a225515_0s.jpg)
Win8下使用Alt+Tab快捷键切换窗口时没有缩略图怎么办
2023-01-03 01:54:46
![](https://img.aspxhome.com/file/2023/29/a252444_0s.jpg)
寻找未保存的word文档
2023-01-25 02:53:43
Excel中LOG10函数的语法和用法
2023-11-01 12:13:27
![](https://img.aspxhome.com/file/2023/5/a155895_0s.png)
WPS怎么制作圆环百分比图表?
2023-11-30 20:16:41
![](https://img.aspxhome.com/file/2023/6/a166766_0s.jpg)
怎样把wps设置为默认的打开word的工具
2023-11-30 02:25:14
![](https://img.aspxhome.com/file/2023/2/18862_0s.jpg)
轻松创建公式 要得出2006年与2005年收入之差
2023-05-04 21:32:49
Windows 10突然加速狂奔:第一大桌面系统指日可待
2022-04-17 07:18:05
![](https://img.aspxhome.com/file/2023/4/a309585_0s.jpg)
ppt幻灯片怎么调整播放顺序? ppt设置动画顺序的教程
2023-03-04 18:18:25
![](https://img.aspxhome.com/file/2023/10/a346285_0s.jpg)
Win10系统设置屏幕自动关闭时间操作步骤
2023-09-02 18:01:40
![](https://img.aspxhome.com/file/2023/28/a250741_0s.png)