WorkbookBase.PublishObjects 屬性
取得 Microsoft.Office.Interop.Excel.PublishObjects 集合。
命名空間: Microsoft.Office.Tools.Excel
組件: Microsoft.Office.Tools.Excel.v4.0.Utilities (在 Microsoft.Office.Tools.Excel.v4.0.Utilities.dll 中)
語法
'宣告
Public ReadOnly Property PublishObjects As PublishObjects
public PublishObjects PublishObjects { get; }
屬性值
型別:Microsoft.Office.Interop.Excel.PublishObjects
Microsoft.Office.Interop.Excel.PublishObjects 集合。
範例
下列程式碼範例使用 PublishObjects 屬性,將現用活頁簿的所有靜態 Microsoft.Office.Interop.Excel.PublishObject 項目發行至 Web 網頁。
這是示範文件層級自訂的範例。
Private Sub WorkbookPublishObjects()
Dim i As Integer
For i = 1 To Me.PublishObjects.Count
If Me.PublishObjects(i).HtmlType = _
Excel.XlHtmlType.xlHtmlStatic Then
Me.PublishObjects(i).Publish()
End If
Next i
End Sub
private void WorkbookPublishObjects()
{
for (int i = 1; i <= this.PublishObjects.Count; i++)
{
if (this.PublishObjects[i].HtmlType ==
Excel.XlHtmlType.xlHtmlStatic)
{
this.PublishObjects[i].Publish();
}
}
}
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。