using system.diagnostic.process

  • Thread starter Thread starter sandro72
  • Start date Start date
S

sandro72

I found the classes you wrote of but it doesn't work. i tested also this
code but it cretaes instances of worpad.exe that i only see

by task manager and i cannot terminate them. have you any ideas?



Dim pr As New System.Diagnostics.Process

pr.StartInfo.WindowStyle = Diagnostics.ProcessWindowStyle.Normal

pr.StartInfo.CreateNoWindow = False

pr.Start("C:\Programmi\Windows NT\Accessori\wordpad.exe")
 
* "sandro72 said:
I found the classes you wrote of but it doesn't work. i tested also this
code but it cretaes instances of worpad.exe that i only see

by task manager and i cannot terminate them. have you any ideas?

\\\
System.Diagnostics.Process.Start("C:\Programmi\Windows NT\Accessori\wordpad.exe")
///
 
same problem. i also gave all rights to user aspnet for wordpad but nothing
changed.
in VB6.0 the following code works fine:

Dim myapp As Word.Application
Set myapp = New Word.Application
Dim mydoc As New Word.Document

Set mydoc = myapp.Documents.Open("C:\ss.doc")
mydoc.Activate
myapp.PrintOut

in vb.net it starts winword (i can see it in task manager) but no windows
appear and no printing process is started.
Dim myapp As Word.Application

myapp = New Word.Application

Dim mydoc As New Word.Document

mydoc = myapp.Documents.Open("C:\ss2.doc")

mydoc.Activate()

myapp.PrintOut()



can it be any .net confiuration?
 
Hi Sandro,

You need to ask word to make it visible.

Dim moWordApp As Word.Application
Dim moWordDoc As Word.Document

Set WordApp = New Word.Application
WordApp.Visible = True
moWordDoc.SaveAs "SOMEDOCUMENT"
moWordDoc.PrintOut
moWordDoc.Close

Let me know if this helped.


sandro72 said:
same problem. i also gave all rights to user aspnet for wordpad but nothing
changed.
in VB6.0 the following code works fine:

Dim myapp As Word.Application
Set myapp = New Word.Application
Dim mydoc As New Word.Document

Set mydoc = myapp.Documents.Open("C:\ss.doc")
mydoc.Activate
myapp.PrintOut

in vb.net it starts winword (i can see it in task manager) but no windows
appear and no printing process is started.
Dim myapp As Word.Application

myapp = New Word.Application

Dim mydoc As New Word.Document

mydoc = myapp.Documents.Open("C:\ss2.doc")

mydoc.Activate()

myapp.PrintOut()



can it be any .net confiuration?
 
Back
Top