|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Imports System.Windows.Forms
Public Class ThisAddIn
Private Sub ThisAddIn_Startup() Handles Me.Startup
End Sub
Private Sub ThisAddIn_Shutdown() Handles Me.Shutdown
End Sub
Private Sub Application_DocumentOpen(ByVal Doc As Microsoft.Office.Interop.Word.Document) Handles Application.DocumentOpen
' Create an instance of our form
Dim propertyForm As New frmDocumentDetails
' Add the properties you want to the grid
propertyForm.PropertyGrid.Rows.Add("Full Name", Doc.FullName)
propertyForm.PropertyGrid.Rows.Add("Path", Doc.Path)
propertyForm.PropertyGrid.Rows.Add("Paragraphs", Doc.Paragraphs.Count.
ToString)
propertyForm.PropertyGrid.Rows.Add("Password?", Doc.HasPassword.ToString)
' Show that form!
propertyForm.Show()
End Sub
End Class
|
|