CommandButton.PictureType 屬性 (Access)CommandButton.PictureType property (Access)

您可以使用 PictureType 屬性來指定 Microsoft Access 儲存物件的圖片當做連結或內嵌的物件。You can use the PictureType property to specify whether Microsoft Access stores an object's picture as a linked or an embedded object. 可讀寫的 ByteRead/write Byte.

語法Syntax

運算式PictureTypeexpression.PictureType

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

註解Remarks

PictureType 屬性使用下列設定值。The PictureType property uses the following settings.

設定Setting 描述Description
00 (預設值) 圖片內嵌到物件,且成為資料庫檔案的一部分。(Default) The picture is embedded in the object and becomes part of the database file.
1 1 圖片被連結到物件。The picture is linked to the object. Microsoft Access 在磁碟中儲存圖片位置的指標。Microsoft Access stores a pointer to the location of the picture on the disk.

此屬性只能在表單設計檢視或報表設計檢視中設定。This property can be set only in form Design view or report Design view.

對控制項而言,您可以 Visual Basic 中使用的預設控制項樣式或**DefaultControl** 屬性來設定此屬性的預設值。For controls, you can set the default for this property by using the default control style or the DefaultControl property in Visual Basic.

當此屬性設定為 0 時,資料庫的大小將會增加圖片檔案的大小,且在某些 .wmf 檔案的情況下,還可能會增加圖片檔案兩倍的大小。When this property is set to 0, the size of the database increases by the size of the picture file and, with some .wmf files, the size may increase as much as twice the size of the picture file. 當此屬性設定為 1 時,資料庫大小並不會增加,因為 Microsoft Access 僅在磁碟中儲存圖片位置的指標。When this property is set to 1, there is no increase in the size of the database because Microsoft Access only saves a pointer to the picture's location on the disk.

注意

[!注意事項] 如果連結的檔案的磁碟移到另一個位置時,您必須使用物件的 Picture 屬性來重新建立連結。If a linked file is moved to another location on the disk, you must re-establish the link by using the object's Picture property.

內嵌的圖片物件的 PictureData 屬性會儲存個別的位元構成圖片的圖像。For embedded pictures, the object's PictureData property stores the individual bits that make up a picture's image. 連結的圖片,這個屬性會儲存的圖片檔案的路徑。For linked pictures, this property stores the path to the picture's file.

您可以使用不同的應用程式,來修改連結的圖片,圖片的變更會出現在下次包含該圖片的物件會顯示在資料庫中。You can modify a linked picture by using a separate application, and changes to the picture will appear the next time the object containing that picture is displayed in the database.

範例Example

下列範例會在磁碟上的圖片連結順序輸入表單上Customerphoto圖像控制項中的圖片。The following example links the picture in the Customer Photo image control on the Order Entry form to the picture on the disk. 該圖片並非資料庫檔案的一部分。The picture is not part of the database file.

Forms("Order Entry").Controls("Customer Photo").PictureType = 1 

支援和意見反應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.