'Excel
Dim xlApp As Excel.Application
Set xlApp = New Excel.Application Set xlApp = CreateObject("Excel.Application")
‘激活EXCEL应用程序
xlApp.Visible = False ‘隐藏EXCEL应用程序窗口
Set xlBook = xlApp.Workbooks.Open(strDestination)
‘打开工作簿,strDestination为一个EXCEL报表文件
Set xlSheet = xlBook.Worksheets(1)
‘设定工作表xxx=Cell(4,2)
Dim xlApp As Excel.Application
Set xlApp = New Excel.Application Set xlApp = CreateObject("Excel.Application")
‘激活EXCEL应用程序
xlApp.Visible = False ‘隐藏EXCEL应用程序窗口
Set xlBook = xlApp.Workbooks.Open(strDestination)
‘打开工作簿,strDestination为一个EXCEL报表文件
Set xlSheet = xlBook.Worksheets(1)
‘设定工作表xxx=Cell(4,2)
Dim w1 As Word.Application
Set w1 = New Word.Application'Test to see if there is a document open
If w1.Documents.Count < 1 Then
MsgBox "No documents open"
Exit Sub
End If
'Set the font size
w1.Selection.Font.Size = txtSize.Text
'Set the font weight etc.
w1.Selection.Font.Bold = IIf(chkBold.Value = 1, True, False)
w1.Selection.Font.Italic = IIf(chkItalic.Value = 1, True, False)
w1.Selection.Font.Underline = IIf(chkUnderline.Value = 1, True, False)
'Set the alignment
w1.Selection.ParagraphFormat.Alignment = drpJustification.ListIndex
'Type the text
w1.Selection.TypeText "xxxx"
w1.Quit False
Set w1 = Nothing
excel 就不知道了。