473,395 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

using system.diagnostic.process

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")

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> ha scritto nel
messaggio news:br************@ID-208219.news.uni-berlin.de...
* "sandro72" <gf*****@pippo.com> scripsit:
hi, i need to simulate the right mouse click and choose an option.
i want to use (in .net) the option "print" that appear when i right-click on .doc file and be able to change the printer before and after the print.
can i launch word from command line forcing it to print a document?


\\\
Dim p As New System.Diagnostics.ProcessStartInfo()
p.Verb = "print"
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = "C:\filename.doc"
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


Nov 20 '05 #1
3 5607
* "sandro72" <gf*****@pippo.com> scripsit:
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\Win dows NT\Accessori\wordpad.exe")
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
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?
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> ha scritto nel
messaggio news:br************@ID-208219.news.uni-berlin.de...
* "sandro72" <gf*****@pippo.com> scripsit:
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\Win dows

NT\Accessori\wordpad.exe") ///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3
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" <gf*****@pippo.com> wrote in message
news:br**********@newsread.albacom.net...
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?
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> ha scritto nel
messaggio news:br************@ID-208219.news.uni-berlin.de...
* "sandro72" <gf*****@pippo.com> scripsit:
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\Win dows

NT\Accessori\wordpad.exe")
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Alex | last post by:
Hello, in my company, we have a diagnostic tool for hardware. Depending on the hardware projcet, a different project configuration is needed. The configuration file is written in XML and...
0
by: Stefan Turalski \(stic\) | last post by:
Hi, I need help with one thing - I've simple update application, it's chceck with FineInfo class if file in server has last write time > than file on my disc, if yes it is just update my file...
2
by: adish11 | last post by:
I'm using Web Application and want to execute an MSDOS executable with some parameters like this example: software.exe -i -x How do I use System.Diagnostic.Process to execute this .exe with...
1
by: FredC | last post by:
This works: private Process oneProcess = new Process(); oneProcess.StartInfo.FileName = @"C:\oneProcess.exe"; This gets a 'System.NullReferenceException', Object reference not set to an...
5
by: Paul Bergson | last post by:
I have been trying to get a process to start up and run with arguments passed to it. I have gotten close (Thanks to help from this board) but I there is a failure while I'm running this because...
1
by: Ram | last post by:
Hey, I'm trying to use the "gacutil" exec to register an assembly form an aspx file using the Process Object. Here's the code: Dim objProc As Process objProc = new Process()
6
by: bill | last post by:
I have a VB .net 2.0 site that needs to run a dos app upon a button click. I found Shell too unreliable using parameters and so used system.diagnostic.process. simple troubleshooting...
2
by: willyd61 | last post by:
Hello Everyone! Newbie here... I can't configure any remote clients to connect to my DB2 server, I am able to run and connect local from the server, but if I try to connect with a user and...
0
by: SyGC | last post by:
Greetings All, Ive been able to initiate a system restart in my VB.NET application on a button click with the following code; Private Sub Button1_Click(ByVal sender As System.Object, ByVal...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.