PictureFormat.OriginalIsTrueColor 属性 (Publisher)

返回一个 MsoTriState 常量,该常量指示指定的链接图片或 OLE 对象是否包含每个通道 24 位或更大的颜色数据。 此为只读属性。

语法

表达式OriginalIsTrueColor

表达 一个代表 PictureFormat 对象的变量。

返回值

MsoTriState

备注

此属性仅应用于链接图片或 OLE 对象。 对于代表嵌入或粘贴图片和 OLE 对象的形状,它返回"权限被拒绝"。

使用下列属性之一可确定一个形状是否代表链接图片:

OriginalIsTrueColor 属性值可以是一个 MsoTriState 常量声明在 Microsoft Office 类型库,如下表所示。

常量 说明
msoFalse 指定的链接图片不包含每通道 24 位或更高的颜色数据。
msoTriStateMixed 指示 属性值为 msoTruemsoFalse 指定的形状范围的组合。
msoTrue 指定的链接图片包含每通道 24 位或更高的颜色数据。

示例

以下示例返回活动文档中属于"真彩色"的图片的列表。 如果图片已被链接,并且链接图片也是"真彩色"的,则也返回该信息。

Sub PictureColorInformation() 
Dim pgLoop As Page 
Dim shpLoop As Shape 
 
For Each pgLoop In ActiveDocument.Pages 
 For Each shpLoop In pgLoop.Shapes 
 If shpLoop.Type = pbLinkedPicture Or shpLoop.Type = pbPicture Then 
 
 With shpLoop.PictureFormat 
 If .IsEmpty = msoFalse Then 
 
 If .IsTrueColor = msoTrue Then 
 Debug.Print .Filename 
 Debug.Print "This picture is TrueColor" 
 If .IsLinked = msoTrue Then 
 If .OriginalIsTrueColor = msoTrue Then 
 Debug.Print "The linked picture is also TrueColor." 
 End If 
 End If 
 End If 
 
 End If 
 End With 
 
 End If 
 Next shpLoop 
Next pgLoop 
 
End Sub

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。