以 Range 对象形式返回信件收件人地址。只读。
expression.Address
expression 必需。该表达式返回以上一个对象。
注意 如果还未向指定文档添加信封,使用本属性则会出错。
返回或设置指定超链接的地址(例如,文件名或 URL)。String 类型,可读写。
expression.Address
expression 必需。该表达式返回以上一个对象。
如果已向活动文档添加信封,则本示例显示收信人地址;否则显示一条消息。
On Error GoTo errhandler
addr = ActiveDocument.Envelope.Address.Text
MsgBox Prompt:=addr, Title:="Delivery Address"
errhandler:
If Err = 5852 Then MsgBox "Insert an envelope into the document"
本示例可实现的功能是:将超链接添加到活动文档的选定内容,设置地址然后在消息框中显示该地址。
Set aHLink = ActiveDocument.Hyperlinks.Add( _
Anchor:=Selection.Range, _
Address:="http://forms")
MsgBox "The hyperlink goes to " & aHLink.Address
如果活动文档包含超链接,则本示例会在文档的末尾插入所有超链接的目标列表。
Set myRange = ActiveDocument _
.Range(Start:=ActiveDocument.Content.End - 1)
Count = 0
For Each aHyperlink In ActiveDocument.Hyperlinks
Count = Count + 1
With myRange
.InsertAfter "Hyperlink #" & Count & vbTab
.InsertAfter aHyperlink.Address
.InsertParagraphAfter
End With
Next aHyperlink