Wrox Programmer Forums
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 1st, 2011, 10:00 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 112
Thanks: 12
Thanked 0 Times in 0 Posts
Default call shell( command???

Hi to all...

need help on call shell command...
here is the code i'm using... and working fine BUT


Call Shell("C:\Program Files\Windows NT\Accessories\wordpad.exe /p C:\CR000177.001", vbNormalFocus)

is there a way i can remove header,footer's and set margin to zero when printing...
its causing me issues when printing...

or is there another way i can do this???

Thanking you in advance...
Rino
 
Old June 1st, 2011, 10:24 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 112
Thanks: 12
Thanked 0 Times in 0 Posts
Default

got it to work by using textpad worked perfect...

Call Shell("C:\Program Files\TextPad 4\TextPad.exe /p C:\CR000177.001", vbNormalFocus)

my now other problem when i put in my variable in place of my file path

Call Shell("C:\Program Files\TextPad 4\TextPad.exe /p PathFileToPrint", vbNormalFocus)

it give me an error "file can not be found"...

does anyone know why????
 
Old June 1st, 2011, 10:34 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 112
Thanks: 12
Thanked 0 Times in 0 Posts
Default

got it....

Call Shell("C:\Program Files\TextPad 4\TextPad.exe /p " & PathFileToPrint & " ", vbNormalFocus)
 
Old June 2nd, 2011, 10:13 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 112
Thanks: 12
Thanked 0 Times in 0 Posts
Default

hi to all...

just got in another issue...

Call Shell("C:\Program Files\TextPad 4\TextPad.exe /p " & PathFileToPrint & " ", vbNormalFocus)

i installed my exe on another PC so it can run in the background...

now its just printing my file name and todays date... it not printing nothing from my file...
yes i do have textpad installed and the dll needed to run the exe...
and i removed the /p to see if when i run it, it opens in textapd and i see all the info...

does anyone why???





Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a shell command in sharepoint. Final_Boss SharePoint Development 0 August 17th, 2007 12:24 PM
Shell command under Windows Vista mileski Access VBA 0 April 16th, 2007 10:17 AM
Shell Command doesn't respond in W2K machines kan_lenny Pro VB.NET 2002/2003 0 September 13th, 2006 07:36 PM
Shell command execution error toshesh VB Databases Basics 3 January 7th, 2006 03:17 AM
Shell command refusing to work underscore10304 Access VBA 4 October 20th, 2004 02:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.