狂自私

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

随笔分类 -  Windows / VBA

删除连续的空行
摘要:Sub DeleteConsecutiveEmptyParagraphs() paraCount = ActiveDocument.Paragraphs.Count idx = 2 Do While idx < paraCount forward_Paragraph = Replace(Replac 阅读全文

posted @ 2024-06-03 17:06 狂自私 阅读(8) 评论(0) 推荐(0) 编辑

select_range
摘要:Function select_range(start_title_str As String, end_title_str As String, Optional style_str As String = "标题 1") As Boolean '选择范围,通过指定本标题字符串(start_tit 阅读全文

posted @ 2024-05-26 08:47 狂自私 阅读(12) 评论(0) 推荐(0) 编辑

创建超链接
摘要:Sub 创建超链接() ' ' 创建超链接 宏 ' 为所选择的表格的第一列的cmdlet命令创建对应的超链接(前提是已经存在对应的命令说明内容) ' 只处理第一个表格 ' Application.ScreenUpdating = False '关闭同步调整更新 Dim my_table As Tab 阅读全文

posted @ 2024-05-26 08:47 狂自私 阅读(24) 评论(0) 推荐(0) 编辑

标题查询
摘要:Sub 标题查询() ' ' 标题查询 宏 ' 用来查询样式为标题n(1≤n≤9)的标题 ' Dim title_n Dim find_str As String find_str = InputBox("请输入要查找的内容:", "标题内容查询:输入查询内容") '做简单的合法性判断 If (Le 阅读全文

posted @ 2024-05-26 08:47 狂自私 阅读(22) 评论(0) 推荐(0) 编辑

cmdlet_命令查询
摘要:Sub cmdlet_命令查询() ' ' 查找 宏 ' ' Result = select_range("cmdlet 命令", "Server 2016 core") Selection.Find.ClearFormatting Selection.Find.Style = ActiveDocu 阅读全文

posted @ 2024-05-26 08:46 狂自私 阅读(26) 评论(0) 推荐(0) 编辑

调整cmdlet命令的顺序
摘要:Sub 调整cmdlet命令的顺序() ' ' 调整about标题的顺序 宏 ' ' Result = select_range("cmdlet 命令", "Server 2016 core") If (Result) Then Selection.SortByHeadings wdSortFiel 阅读全文

posted @ 2024-05-26 08:45 狂自私 阅读(6) 评论(0) 推荐(0) 编辑

调整about标题的顺序
摘要:Sub 调整about标题的顺序() ' ' 调整about标题的顺序 宏 ' ' Result = select_range("about配置文件", "实战:远程巡检希沃一体机的运行信息") If (Result) Then Selection.SortByHeadings wdSortFiel 阅读全文

posted @ 2024-05-26 08:44 狂自私 阅读(5) 评论(0) 推荐(0) 编辑

调整表格为自己喜欢的样式
摘要:Sub 调整表格为自己喜欢的样式() ' ' 表格左对齐 宏 ' 且文字环绕 Application.ScreenUpdating = False '关闭同步调整更新 Dim mytable As Table, i As Long For Each mytable In ActiveDocument 阅读全文

posted @ 2024-05-26 08:43 狂自私 阅读(7) 评论(0) 推荐(0) 编辑

自适应/调整图片大小为页面大小
摘要:Sub ResizeImagesToPageWidth() Application.ScreenUpdating = True ' 获取当前文档 Set doc = ActiveDocument ' 获取页面宽度并减去页边距 With doc.PageSetup pgWidth = .PageWid 阅读全文

posted @ 2024-05-26 08:43 狂自私 阅读(17) 评论(0) 推荐(0) 编辑

word VBA Selection.PasteSpecial 4198 运行时错误
摘要:If (.Execute) Then Selection.Copy '要定位到表格中 my_table.Cell(row_index, 1).Select 'Selection.Delete CreateObject("Excel.Application").Wait (Now + TimeValu 阅读全文

posted @ 2023-06-29 17:37 狂自私 阅读(278) 评论(0) 推荐(0) 编辑

VBA-选择标题的内容
摘要:简单说明 这个是模仿但是不是wod自带的功能:选择标题和内容 这个功能能方便的快速选择这个标题下面的所有内容。 要选定是因为我要对这个标题下面的子标题进行排序,但是排序的话,不能有父标题,也就是说,选择的内容中的最高标题要是同级别(有父标题就排序父标题去了,但是父标题又只有一个,排序个der啊)。 阅读全文

posted @ 2023-05-02 15:13 狂自私 阅读(187) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示