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

返回或设置当您将指定的项目保存到网页中时由 Microsoft Excel 生成的 HTML 类型。Returns or sets the type of HTML generated by Microsoft Excel when you save the specified item to a webpage. 可以是一个**XlHtmlType** 常量, 用于指定项目在网页上是静态的还是交互式的。Can be one of the XlHtmlType constants specifying whether the item is static or interactive on the webpage. 默认值为 xlHtmlStaticThe default value is xlHtmlStatic.



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


本示例将活动工作簿中第一个工作表上的单元格区域 D5: D9 保存到名为 Stockreport.htm 的网页中。This example saves the range D5:D9 on the First Quarter worksheet in the active workbook to a webpage called Stockreport.htm.

With ActiveWorkbook.PublishObjects.Add(SourceType:=xlSourceRange, _ 
 Filename:="\\Server\Stockreport.htm", Sheet:="First Quarter", Source:="$G$3:$H$6", _ 
 HtmlType:=xlHtmlStatic, DivID:="Book1_4170") 
 .Publish (True) 
 .AutoRepublish = False 
End With

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