Hi,
I have to do the same process. I have been able to open, edit and close a word document. But, when I want to print it from a web project, i can't do it. I have tried to do it from a Windows project and I have done it.
This is the code:
Public Sub SendToPrinter()
Dim oEnum1 As New Word.WdPrintOutPages
Dim oEnum2 As New Word.WdPrintOutItem
Dim oEnum3 As New Word.WdPrintOutRange
Dim oWordApp As Word.ApplicationClass
Try
oWordApp = New Word.ApplicationClass
oWordApp.ActivePrinter = Me.LocalPrinterName
_word = oWordApp.Documents.Open(CObj(Me.WordPath))
_word.PrintOut(Background:=False, Append:=False, Range:=oEnum3.wdPrintAllDocument, Item:=oEnum2.wdPrintDocumentContent, Copies:=1, PageType:=oEnum1.wdPrintAllPages, PrintToFIle:=False)
_word.Close()
oWordApp.Quit()
Catch ex As Exception
If Not Me._word Is Nothing Then
_word.Close()
End If
If Not oWordApp Is Nothing Then
oWordApp.Quit()
End If
Finally
Marshal.ReleaseComObject(oWordApp)
End Try
End Sub
It works in windows project but not in web project. why???
Julián Sanz
Microsoft Technology Group
GPM FactorÃa Internet
(923) 100 300
http://www.gpm.es