下拉式方塊ComboBox

您可以使用Hyperlink屬性可傳回**Hyperlink** 物件的參照,並存取屬性和控制項的超連結的方法。You can use the Hyperlink property to return a reference to a Hyperlink object and to access the properties and methods of a control's hyperlink. 唯讀。Read-only.

語法Syntax

運算式超連結expression.Hyperlink

_運算式_代表**ComboBox** 物件的變數。expression A variable that represents a ComboBox object.

範例Example

在下列範例中的CreateHyperlink程序設定命令按鈕、 標籤或圖像控制項的超連結屬性來傳遞至程序的位址和子位址值。The CreateHyperlink procedure in the following example sets the hyperlink properties for a command button, label, or image control to the address and subaddress values passed to the procedure. 地址設定是選用的引數,因為到現用資料庫中的物件的超連結會使用僅限的子位址設定。The address setting is an optional argument, because a hyperlink to an object in the current database uses only the subaddress setting.

若要嘗試此範例中,兩個文字方塊控制項 (txtAddresstxtSubAddress) 與命令按鈕 (cmdFollowLink),建立表單並貼入下列表單的模組的宣告區段。To try this example, create a form with two text box controls (txtAddress and txtSubAddress) and a command button (cmdFollowLink), and paste the following into the Declarations section of the form's module.

Private Sub cmdFollowLink_Click() 
 CreateHyperlink Me!cmdFollowLink, Me!txtSubAddress, _ 
 Me!txtAddress 
End Sub 
 
Sub CreateHyperlink(ctlSelected As Control, _ 
 strSubAddress As String, Optional strAddress As String) 
 Dim hlk As Hyperlink 
 Select Case ctlSelected.ControlType 
 Case acLabel, acImage, acCommandButton 
 Set hlk = ctlSelected.Hyperlink 
 With hlk 
 If Not IsMissing(strAddress) Then 
 .Address = strAddress 
 Else 
 .Address = "" 
 End If 
 .SubAddress = strSubAddress 
 .Follow 
 .Address = "" 
 .SubAddress = "" 
 End With 
 Case Else 
 MsgBox "The control '" & ctlSelected.Name _ 
 & "' does not support hyperlinks." 
 End Select 
End Sub

支援和意見反應Support and feedback

有關於 Office VBA 或這份文件的問題或意見反應嗎?Have questions or feedback about Office VBA or this documentation? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.