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


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

Re: Shell to print

From "D&JG" <donandjane1@dodo.com.au>
Newsgroups comp.lang.basic.visual.misc
References <4dc09c4c$0$61662$c30e37c6@pit-reader.telstra.net>
Subject Re: Shell to print
Date 2011-05-06 09:36 +1000
Message-ID <4dc33480$0$61657$c30e37c6@pit-reader.telstra.net> (permalink)

Show all headers | View raw


Thanks, guys, for your replies.  I can't remember where I found the original 
code but it has been very useful when copy/pasting, from one program to 
another, whenever a Word .doc needed printing.  My latest thinking is that 
it might relate to Win 7 and Office 7 together not recognising what is 
required.  Works fine in XP with Office 7 and Office 10.

More code detail might give insight...

Private Declare Function ShellExecute Lib "shell32.dll" _

Alias "ShellExecuteA" _

(ByVal hwnd As Long, _

ByVal lpOperation As String, _

ByVal lpFile As String, _

ByVal lpParameters As String, _

ByVal lpDirectory As String, _

ByVal nShowCmd As Long) As Long

=================

sFile = Fn


Call RunShellExecute(sTopic, sFile, sParams, sDirectory, SW_SHOWDEFAULT)

=================

Private Sub RunShellExecute(sTopic As String, _

sFile As Variant, _

sParams As Variant, _

sDirectory As Variant, _

nShowCmd As Long)

Dim hWndDesk As Long

Dim success As Long


'the desktop will be the

'default for error messages

hWndDesk = GetDesktopWindow()


'execute the passed operation

success = ShellExecute(hWndDesk, sTopic, sFile, sParams, sDirectory, 
nShowCmd)

End Sub

>
> The document loads into MSOffice, 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.
>  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