SourceType 属性 (Excel) PublishObjectPublishObject.SourceType property (Excel)

返回一个**XlSourceType** 值, 该值代表要发布的项目的类型。Returns an XlSourceType value that represents the type of item being published.

语法Syntax

表达式SourceTypeexpression.SourceType

_表达式_一个代表**PublishObject** 对象的变量。expression A variable that represents a PublishObject object.

示例Example

本示例确定保存为网页的第一个图表 (第一个工作簿) 的唯一名称, 然后将该布尔变量blnChartFound设置为TrueThis example determines the unique name of the first chart (in the first workbook) saved as a webpage, and then it sets the Boolean variable blnChartFound to True. 如果文档中没有另存为图表组件的项目, blnChartFound则为FalseIf no items in the document have been saved as Chart components, blnChartFound is False.

blnChartFound = False 
For Each objPO In Workbooks(1).PublishObjects 
    If objPO.SourceType = xlSourceChart Then 
        strFirstPO = objPO.Source 
        blnChartFound = True 
        Exit For 
    End If 
Next objPO

支持和反馈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.