Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

適用對象

BoundObjectFrame 物件

ObjectFrame 物件

您可以使用 SourceItem 屬性來指定當您建立連結的 OLE 物件時,要連結檔案中的哪些資料。 讀/寫字串

expression.SourceItem

運算式 必要。 傳回 [套用至] 清單中其中一個對象的表達式。

備註

您可以提供物件之應用程式所辨識的單位指定資料,藉此設定 SourceItem 屬性。 例如,當您連結至 Microsoft Office Excel 2007,您可以使用儲存格或儲存格範圍參照 (例如 R1C1 或 R3C4:R9C22) 或具名的範圍 (例如「營收」) 來指定 SourceItem 屬性設定。

附註: 若要判斷用於描述特定物件之資料單位的語法,請參閱用來建立物件的應用程式說明文件。

您可以使用控制項的屬性工作表、巨集或 Visual Basic for Applications (VBA) 程式碼來設定此屬性。

在 Visual Basic 中,您可以使用字串運算式來設定此屬性。

使用此屬性時,您必須將控制項的 OLETypeAllowed 屬性設為 [Linked] 或 [Either]。 請使用控制項的 SourceDoc 屬性來指定要連結的檔案。

範例

以下範例會在使用者按一下命令按鈕時,建立使用未繫結物件框架 OLE1 的連結 OLE 物件,並調整控制項大小以顯示物件的所有內容。

Sub Command1_Click
OLE1.Class = "Excel.Sheet" ' Set class name.
' Specify type of object.
OLE1.OLETypeAllowed = acOLELinked
' Specify source file.
OLE1.SourceDoc = "C:\Excel\Oletext.xls"
' Specify data to create link to.
OLE1.SourceItem = "R1C1:R5C5"
' Create linked object.
OLE1.Action = acOLECreateLink
' Adjust control size.
OLE1.SizeMode = acOLESizeZoom
End Sub

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×