Hyperlink.Address プロパティ (Publisher)

返すまたは、ハイパーリンクの URL アドレスを表す 文字列 を設定します。 値の取得と設定が可能です。

構文

アドレス

Hyperlink オブジェクトを表す変数。

戻り値

String

次の使用例では、作業中の文書にあるすべてのハイパーリンクの URL アドレスを表示します。

Sub ShowHyperlinkAddresses() 
 Dim pgsPage As Page 
 Dim shpShape As Shape 
 Dim hprLink As Hyperlink 
 Dim intCount As Integer 
 For Each pgsPage In ActiveDocument.Pages 
 For Each shpShape In pgsPage.Shapes 
 If shpShape.TextFrame.TextRange.Hyperlinks.Count > 0 Then 
 For Each hprLink In shpShape.TextFrame.TextRange.Hyperlinks 
 MsgBox "This hyperlink goes to " & hprLink.Address & "." 
 intCount = intCount + 1 
 Next hprLink 
 ElseIf shpShape.Hyperlink.Address <> "" Then 
 MsgBox "This hyperlink goes to " & shpShape.Hyperlink.Address & "." 
 intCount = intCount + 1 
 End If 
 Next shpShape 
 Next pgsPage 
 If intCount < 1 Then 
 MsgBox "You don't have any hyperlinks in your publication." 
 Else 
 MsgBox "You have " & intCount & " hyperlinks in " & ThisDocument.Name & "." 
 End If 
End Sub

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。