PictureFormat.IsGreyScale 属性 (Publisher)

返回一个 MsoTriState 常量,该常量指示图片是否为灰度图像。 此为只读属性。

语法

表达式IsGreyScale

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

返回值

MsoTriState

备注

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

常量 说明
msoFalse 图片不是灰度图像。
msoTriStateMixed 指示 属性值为 msoTruemsoFalse 指定的形状范围的组合。
msoTrue 指定的图片为灰度图像。

示例

以下示例返回包含在当前出版物中的灰度图片列表。

Sub ListGreyScalePictures() 
Dim pgLoop As Page 
Dim shpLoop As Shape 
 
 For Each pgLoop In ActiveDocument.Pages 
 For Each shpLoop In pgLoop.Shapes 
 
 If shpLoop.Type = pbPicture Or shpLoop.Type = pbLinkedPicture Then 
 
 With shpLoop.PictureFormat 
 If .IsEmpty = msoFalse And .IsGreyScale = msoCTrue Then 
 
 Debug.Print .Filename 
 Debug.Print "Page " & pgLoop.PageNumber 
 
 End If 
 End With 
 
 End If 
 
 Next shpLoop 
 Next pgLoop 
 
End Sub

支持和反馈

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