|
以为经过急(1)
http://www.chinanews.com/sh/2014/08-04/6457771.shtml(1)
l每吨水最高或上涨4.3元(2)
http://js.people.com.cn/n/2014/0804/c360311-21876440.html(2)
水价明年涨至1.47元/m3(3)
http://news.sina.com.cn/c/2014-08-05/051930630905.shtml(3)
完善污水处理系统(4)
http://news.sina.com.cn/c/2014-08-05/051930630905.shtml(4)
污水处理厂和再生水厂(5)
http://stock.jrj.com.cn/hotstock/2014/08/04080017732654.shtml(5)
我想写段vba自动把网址剪切后超链接到word 的文字标题上,有几千个求帮忙
Sub 学习2()
'
' 学习2 宏
'
Dim myaddress As String
Application.Move Left:=668, Top:=330
Selection.Find.ClearFormatting
With Selection.Find.Font
.Bold = False
.Italic = False
End With
With Selection.Find
.Text = "http://*^13"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
' Selection.Text = ptwd
Selection.Find.Execute
Do Until Selection.Find.Found = False
'Selection.Find.Execute
Selection.Cut
'.Paste = myaddress
Selection.Text = myaddress
' Selection.Text = ptwd
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Range.Hyperlinks(1).Range.Fields(1).Result.Select
Selection.Range.Hyperlinks(1).Delete
' ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
"http://news.ifeng.com/a/20140813/41554950_0.shtml"(想把这段改成不是固定网页), SubAddress:=""
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:=myaddress, SubAddress:=""
红色这段修改失败
Selection.Collapse Direction:=wdCollapseEnd
Selection.Find.ClearFormatting
With Selection.Find.Font
.Bold = False
.Italic = False
End With
If Selection.Find.Found = False Then
Exit Do
End If
Loop
End Sub
|
|