Starting and quitting Word programmatically
To start an instance of Word I use the code
Code:
oWord = CreateObject("Word.Application")
oWord.Visible = True
oDoc = oWord.Documents.Add("H:\Customer.dot", , , True)
'oWord.Quit()
First off, I do not see word starting up, second I don't see word appear at all. :eek: However, in the taskmanager it is started, but cannot end the process...:mad:
When I activate the code oWord.Quit() I get an error message before compile stating :
C:\Inetpub\wwwroot\App\WordInterface.asmx.vb(48): 'Quit' is ambiguous across the inherited interfaces 'Word._Application' and 'Word.ApplicationEvents2_Event'.
How do I solve these problems?
I appreciate your help, thanx...
Dozo :(
not able to set visible to true
Unfortunately I still can't set .Visible tot true.
The code I use is the following:
Code:
Dim oWord As New Word.Application()
<WebMethod()> Public Function PrintKlant() As String
oWord.Visible = True
oWord.Documents.Add("H:\Test.dot", , , True)
oWord.Application.ActiveDocument.PrintPreview()
'oWord.Quit()
End Function
ALthough I set .Visible to true, it stays False.
And I stil get the ambiguous warning for the quit statment.
Found part of the problem
The quit statement seems to have a bug in .NET;
More on this at microsoft:
support.microsoft.com/default.aspx?scid=KB;EN-US;Q315981&
This leaves me with just 1 problem: How do I make Word visible :confused:
Thanx for the help though,
Dozo