Dim Book As New XLS.Book '定义一个Excel工作簿
Dim Sheet As XLS.Sheet = Book.Sheets(0) '引用工作簿的第一个工作表
Sheet(0,0).Value = "Window Width"
Sheet(0,1).Value = e.Form.BaseForm.Width
Sheet(0,2).Value = "Window Height"
Sheet(0,3).Value = e.Form.BaseForm.Height
Dim r As Integer = 1
Dim items As String() = {"Name","Left","Top","Width","Height","Visible","Printable"}
For c As Integer = 0 To items.Length -1
Sheet(r,c).Value = items(c)
Next
Sheet(r,items.Length).Value = "Font.Name"
Sheet(r,items.Length+1).Value = "Font.Size"
Sheet(r,items.Length+2).Value = "Font.Bold"
r+=1
For Each conl As Winform.Control In e.Form.Controls
For c As Integer = 0 To items.Length -1
Sheet(r,c).Value = conl.Gettype.GetProperty(items(c)).GetValue(conl, Nothing)
Next
Sheet(r,items.Length).Value = conl.Font.Name
Sheet(r,items.Length+1).Value = conl.Font.Size
Sheet(r,items.Length+2).Value = conl.Font.Bold
r+=1
Next
'打开工作簿
Book.Save("d:\test.xls")
Dim Proc As New Process
Proc.File = "d:\test.xls"
Proc.Start()