I don't quite understand the literature I have read on garbage disposal.
Is it OK to do what I have done here or do I have to call the Dispose() method?
Whats the difference?
I added a reference to the COM Object Microsoft Word 9 Object Library (and the Excel equivalent).
Is there a better way to interface with Office applications?VB Code:
Dim wdApp As New Word.Application Dim xlApp As New Excel.Application 'Show Word wdApp.Visible = True 'Open new document based on template wdApp.Documents.Add("X:\temp.dot") 'Fill out address wdApp.ActiveDocument.Bookmarks.Item("Address").Select() wdApp.Selection.TypeText(Text:=strName) wdApp.Selection.TypeParagraph() wdApp.Selection.TypeText(Text:=strCompany) wdApp.Selection.TypeParagraph() 'Release reference to MS Word wdApp = Nothing 'Show Excel xlApp.Visible = True 'Open billing log xlApp.Workbooks.Open(Filename:=sheet.xls") xlApp.ActiveCell.Offset(0, 1).Select() xlApp.ActiveCell.FormulaR1C1 = DateTime.Today 'Release reference to MS Excel xlApp = Nothing




Reply With Quote