惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
WordPress大学
WordPress大学
V
V2EX
Jina AI
Jina AI
S
Schneier on Security
Cyberwarzone
Cyberwarzone
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
PCI Perspectives
PCI Perspectives
美团技术团队
小众软件
小众软件
L
LangChain Blog
N
Netflix TechBlog - Medium
大猫的无限游戏
大猫的无限游戏
T
Threatpost
T
Tor Project blog
K
Kaspersky official blog
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Security Latest
Security Latest
H
Heimdal Security Blog
N
News and Events Feed by Topic
T
Threat Research - Cisco Blogs
J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
M
MIT News - Artificial intelligence
Apple Machine Learning Research
Apple Machine Learning Research
N
News | PayPal Newsroom
I
Intezer
博客园 - 聂微东
U
Unit 42
Cisco Talos Blog
Cisco Talos Blog
量子位
T
The Exploit Database - CXSecurity.com
Last Week in AI
Last Week in AI
博客园_首页
月光博客
月光博客
Webroot Blog
Webroot Blog
I
InfoQ
The Cloudflare Blog
Attack and Defense Labs
Attack and Defense Labs
人人都是产品经理
人人都是产品经理
Project Zero
Project Zero
Hacker News: Ask HN
Hacker News: Ask HN
IT之家
IT之家
Google DeepMind News
Google DeepMind News
C
Cisco Blogs

博客园 - wj-conquer

Oracle数据库管理员面试题 dl, dt, dd标签的使用方法 新年到了, 写了几个网页祝福大家新年快乐, 万事如意 java根据自定义标记分割字符串 如何使用freemarker将jsp网页静态化? jsp获取相对路径网址的方法 request.getContextPath() 百度广告联盟号被封 网站被降权 SQLServer如何取得随机获取的数据库记录 IE出问题,所有网页提示脚本错误 CSS使文章自动换行的问题 很精美的仿京东商城产品详细JS放大效果 JSP面试题及答案 四大方法提升百度联盟点击率 Java中随机数生成, Manth和Random的用法 在页面中显示系统当前时间,在页面中加载时间 Unable to load configuration. - bean struts-default.xml struts2中的jar包冲突 设置首页 加入收藏代码 百度搜索引擎的代码、百度搜索功能的码代 Java调用SQL Server存储过程同时返回参数和结果集
word2007中批量添加超链接的方法
wj-conquer · 2012-11-15 · via 博客园 - wj-conquer

在word文档如何批量添加超链接。在发一篇长文章,里面有很多超链接要打,如果一个一个的加就会效率很低, 我们可以利用word的宏VBA来实现批量添加超链接。

当我们做好一个word文档的时候,我们可能希望给每次出现的某个词(如:同行网)都做上超链接,那么,我们在word文档中如何批量添加超链接呢?手动一个一个的添加是一种方法,但如果文档内容很长时(如几十页,几百页内容),这种方法明显很难执行,这种方法不是我们提倡的,我们需要更有效率的方法。

现在教大家用宏来实现word文档中批量添加超链接。

步骤如下:

1、打开需要编辑的word文档。

2、Alt+F11 打开宏编辑器。

3、在编辑器(按F7)中加入以下代码:

Sub AddHyperlink()
'
' AddHyperlink 宏
' 批量添加超链接
'
Selection.Find.ClearFormatting
Dim i
For i = 1 To 500
With Selection.Find
.Text = "同行网"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
ChangeFileOpenDirectory _
"C:\Documents and Settings\jason\My Documents\"
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
"http://www.txw100.com", SubAddress:="", ScreenTip:="", TextToDisplay:= _
"同行网", Target:="_blank"
Next i
End Sub

说明:

1)将黄底文字“同行网”改成你要添加链接的词。

2)将红底文字C:\Documents and Settings\jason\My Documents\ 改成你打开的word文档所在的位置。

3)将蓝底文字http://www.txw100.com 换成你要添加的超链接。

4)按F5运行,就可以得到你想要的结果了。