Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.basic.visual.misc > #119

Re: Shell to print

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From "Mayayana" <mayayana@invalid.nospam>
Newsgroups comp.lang.basic.visual.misc
Subject Re: Shell to print
Date Wed, 4 May 2011 08:48:53 -0400
Organization A noiseless patient Spider
Lines 52
Message-ID <iprhsn$pc8$1@dont-email.me> (permalink)
References <4dc09c4c$0$61662$c30e37c6@pit-reader.telstra.net>
Injection-Date Wed, 4 May 2011 12:47:19 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="hA0LZgtsTmFlvERssm/+Tg"; logging-data="25992"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4SNWy+0pshK2A43qsRHAjNP2KU5Vhcm4="
X-MimeOLE Produced By Microsoft MimeOLE V6.00.2900.5512
X-Newsreader Microsoft Outlook Express 6.00.2900.5512
Cancel-Lock sha1:d/6bUc+I6um9EUtxSYhiPf6MpZ4=
X-Priority 3
X-MSMail-Priority Normal
Xref x330-a1.tempe.blueboxinc.net comp.lang.basic.visual.misc:119

Show key headers only | View raw


| The following code has worked for years in sending a click-selected .doc
| file to any default printer:
| sFile = Filename
|
|
| Call RunShellExecute(sTopic, sFile, sParams, sDirectory, SW_SHOWDEFAULT)
|

  I searched for RunShellExecute, since it's not actually
a function. Apparently you copied and pasted your code
from Randy Birch's site? Posting only the call to his
function doesn't provide any clues about what the problem
might be.

   I don't use Word, but I know it has an automation
interface. If all you want to do is to automate Word
to print Word .docs, then why not just automate Word?

  You'd need to check the details, but I think it's something
like this:

Set OWord = CreateObject("Word.Application")
Set Doc = OWord.Documents.Open("C:\Windows\Desktop\some.doc")
Doc.Print
Doc.Close
Set Doc = Nothing
OWord.Quit
Set OWord = Nothing

(I posted the code as late-bound so as to not cause
problems if, for some reason, you might run your software
on a PC without Word installed.)

| The document loads into MSOffice Word 2007, prints, and the program 
returns
| to continue as expected.  So far, this has been flawless in systems
| operating with Win XP.  Since attempting to run this from Windows 7,
| however, the function does not work.  Does Win 7 execute Shells 
differently?
|
| Any ideas appreciated.
|
| Don
|
|
|
|
|
| 

Back to comp.lang.basic.visual.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Shell to print "D&JG" <donandjane1@dodo.com.au> - 2011-05-04 10:22 +1000
  Re: Shell to print "Auric__" <not.my.real@email.address> - 2011-05-04 08:05 +0000
  Re: Shell to print Dee Earley <dee.earley@icode.co.uk> - 2011-05-04 11:27 +0100
  Re: Shell to print "Mayayana" <mayayana@invalid.nospam> - 2011-05-04 08:48 -0400
  Re: Shell to print Steve Rindsberg <steve@rdpslides.com> - 2011-05-04 12:11 -0400
  Re: Shell to print "D&JG" <donandjane1@dodo.com.au> - 2011-05-06 09:36 +1000
    Re: Shell to print Dee Earley <dee.earley@icode.co.uk> - 2011-05-06 08:57 +0100
      Re: Shell to print "D&JG" <donandjane1@dodo.com.au> - 2011-06-06 23:41 +1000

csiph-web