#眉標=Office、VSTO、MVC #副標=Office 2007開發系列(10) #大標=利用VSTO動態存取Office控制項 #作者=文/圖 沈炳宏 ============= 程式1 SendUpdateEmail _ ThisWorkbook.Sheets(1). Cells(12,15).Value2 ================ ============= 程式2 SendUpdateEmail _ ThisWorkbook.Names("ApproverEmail"). RefersToRange.Value2 ================ ============= 程式3 SendUpdateEmail(ExpenseReportSheet. ApproverEmail.Value2) ================ ============= 程式4 For Each control As Object In Me.Controls If TypeOf control Is Button Then Dim button As Button = control button.Enabled = False End If Next ================ ============= 程式5 Friend Function DynamicallyAddWorksheet( _ ByVal worksheet As Microsoft.Office.Interop.Excel.Worksheet) _ As Microsoft.Office.Tools.Excel.Worksheet ===<反灰>============= ============= 程式6 Private Sub Sheet1_Startup( ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Me.Startup Globals.Sheet2.MyRange.Value = "Hello" End Sub ================