[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Printing from WindowXP version of emacs
From: |
LENNART BORGMAN |
Subject: |
Re: Printing from WindowXP version of emacs |
Date: |
Wed, 04 Jan 2006 09:45:10 +0100 |
Unfortunately I get
C:\mydir\getPrn.vbs(22, 1) (null): 0x80041017
on the line
For Each objPrinter in colInstalledPrinters
I have a default printer, of course.
Content-Type: multipart/alternative;
boundary="----=_Part_22274_16488965.1136351435778"
------=_Part_22274_16488965.1136351435778
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Incidentally, Visual Basic Mode constantly gives me
Invalid regexp: "Invalid regular expression"
errors, when I simply try to hit the Enter key. I believe this is a
font-lock problem. Clues will be appreciated.
From: Eli Zaretskii
> Date: Tue, 03 Jan 2006 21:20:10 +0200
> > Thanks. The question is, will this script find usable ports on
> > > systems where people report they cannot find a port name that Emacs
> > > can use?
> >
> > If I run w32prn-customize I get an error. w32prn-default returns
> something like
> >
> > PDF-XChange
> > My Documents\\*.pdf
> > PRINTER15:PASSTHROU
> > PRINTER15:PASSTHROU
> > PRINTER20:RAW
>
> What does the VB script display, when run?
Looks like my alpha release needs some cleaning up. Save the following cod=
e
as
getPrn.vbs, then run it with `cscript getPrn.vbs`
First, it should return your *default* printer port
Next, it dumps all the *generally* useful printer info I could find.
Is it fair to say that
letter, legal, a1, b1
cover all the *common* paper sizes, that Emacs should support?
Let me know, if this new vbs script works. Perhaps I should post the update=
d
code on EmacsWiki, instead of gnu.emacs.sources.
rem --cut-here--
rem Copyright 2006 Bruce Ingalls. Licensed via GPL, http://www.gnu.org
rem Modified from
rem
http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/wmisdk/w=
mi/wmi_tasks__printers_and_printing.asp
rem
http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/wmisdk/w=
mi/win32_printer.asp
strComputer =3D "."
rem note that " _" is line continuation
Set objWMIService =3D GetObject("winmgmts:" _
& "{impersonationLevel=3Dimpersonate}!\\" _
& strComputer & "\root\cimv2")
Set colInstalledPrinters =3D objWMIService.ExecQuery _
("Select * from Win32_Printer Where Default =3D True")
For Each objPrinter in colInstalledPrinters
Wscript.Echo "Your printer port is"
If objPrinter.Network then
Wscript.Echo objPrinter.Name
Wscript.Echo
Wscript.Echo "server " + objPrinter.ServerName
ElseIf objPrinter.Local then
Wscript.Echo objPrinter.PortName
Wscript.Echo
End If
Wscript.Echo "shareName " + objPrinter.ShareName
Wscript.Echo "systemName " + objPrinter.SystemName
For Each cap in objPrinter.CapabilityDescriptions
Wscript.Echo "capabilities " + cap
Next
Wscript.Echo "status " + objPrinter.Status
rem Wscript.Echo "location " + objPrinter.Location
For Each psize in objPrinter.PaperSizesSupported
If psize =3D 7 then
Wscript.Echo "letter size"
ElseIf psize =3D 8 then
Wscript.Echo "legal size"
ElseIf psize =3D 19 then
Wscript.Echo "A1 size"
End If
Next
For Each paper in objPrinter.PrinterPaperNames
Wscript.Echo "paper size " + paper
Next
If not objPrinter.ErrorCleared then
Wscript.Echo objPrinter.Availability
Wscript.Echo objPrinter.ErrorDescription
End If
Next
rem --cut-here--
------=_Part_22274_16488965.1136351435778
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<div><div>Incidentally, Visual Basic Mode constantly gives me<br>
Invalid regexp: "Invalid regular expression"<br>
errors, when I simply try to hit the Enter key. I believe this is a font-lo=
ck problem. Clues will be appreciated.<br>
</div><br><blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid=
rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">From: E=
li Zaretskii<br>Date: Tue, 03 Jan 2006 21:20:10 +0200</blockquote><br><bloc=
kquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, =
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> > Thanks. The question is, will this script find usable =
ports on<br>> > systems where people report they cannot find a port n=
ame that Emacs<br>> > can use?<br>><br>> If I run w32prn-custom=
ize I get an error. w32prn-default returns something like
<br>><br>> PDF-XChange<br>> My Documents\\=
*.pdf<br>> PRINTER15:PASSTHROU<br>> PRINTER15=
:PASSTHROU<br>> PRINTER20:RAW<br><br>What does the VB script=
display, when run?</blockquote><div><br>
Looks like my alpha release needs some cleaning up. Save the followin=
g code as<br>
getPrn.vbs, then run it with `cscript getPrn.vbs`<br>
First, it should return your *default* printer port<br>
Next, it dumps all the *generally* useful printer info I could find.<br>
Is it fair to say that <br>
letter, legal, a1, b1<br>
cover all the *common* paper sizes, that Emacs should support?<br>
<br>
Let me know, if this new vbs script works. Perhaps I should post the update=
d<br>
code on EmacsWiki, instead of gnu.emacs.sources.<br>
<br>
rem --cut-here--<br>
<br>
rem Copyright 2006 Bruce Ingalls. Licensed via GPL, <a href=3D"http://www.g=
nu.org">http://www.gnu.org</a><br>
rem Modified from<br>
rem <a href=3D"http://msdn.microsoft.com/library/default.asp?url=3D/library=
/en-us/wmisdk/wmi/wmi_tasks__printers_and_printing.asp">http://msdn.microso=
ft.com/library/default.asp?url=3D/library/en-us/wmisdk/wmi/wmi_tasks__print=
ers_and_printing.asp
</a><br>
rem <a href=3D"http://msdn.microsoft.com/library/default.asp?url=3D/library=
/en-us/wmisdk/wmi/win32_printer.asp">http://msdn.microsoft.com/library/defa=
ult.asp?url=3D/library/en-us/wmisdk/wmi/win32_printer.asp</a><br>
<br>
strComputer =3D "."<br>
rem note that " _" is line continuation<br>
Set objWMIService =3D GetObject("winmgmts:" _<br>
& "{impersonationLevel=3Dimpersonate}!\\" =
_<br>
& strComputer & "\root\cimv2")<br>
Set colInstalledPrinters =3D objWMIService.ExecQuery _<br>
("Select * from Win32_Printer Where Default =3D Tru=
e")<br>
For Each objPrinter in colInstalledPrinters<br>
Wscript.Echo "Your printer port is"<br>
If objPrinter.Network then<br>
Wscript.Echo objPrinter.Name<br>
Wscript.Echo<br>
Wscript.Echo "server " + obj=
Printer.ServerName<br>
ElseIf objPrinter.Local then<br>
Wscript.Echo objPrinter.PortName<br>
Wscript.Echo <br>
End If<br>
<br>
Wscript.Echo "shareName " + objPrinter.ShareNa=
me<br>
Wscript.Echo "systemName " + objPrinter.System=
Name<br>
<br>
For Each cap in objPrinter.CapabilityDescriptions<br>
Wscript.Echo "capabilities =
" + cap<br>
Next<br>
Wscript.Echo "status " + objPrinter.Status<br>
<br>
rem Wscript.Echo "location " + objPrinter.Location<br>
<br>
For Each psize in objPrinter.PaperSizesSupported<br>
If psize =3D 7 then<br>
Wscript.Echo &=
quot;letter size"<br>
ElseIf psize =3D 8 then<br>
Wscript.Echo &=
quot;legal size"<br>
ElseIf psize =3D 19 then<br>
Wscript.Echo &=
quot;A1 size"<br>
End If<br>
Next<br>
For Each paper in objPrinter.PrinterPaperNames<br>
Wscript.Echo "paper size &q=
uot; + paper<br>
Next<br>
<br>
If not objPrinter.ErrorCleared then<br>
Wscript.Echo objPrinter.Availability<b=
r>
Wscript.Echo objPrinter.ErrorDescripti=
on<br>
End If<br>
Next<br>
<br>
rem --cut-here--<br>
</div></div>
------=_Part_22274_16488965.1136351435778--
_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
- PostScript printing Latin-N (with N != 1) (was: Printing from WindowXP version of emacs), (continued)
- PostScript printing Latin-N (with N != 1) (was: Printing from WindowXP version of emacs), Reiner Steib, 2006/01/10
- Re: PostScript printing Latin-N (with N != 1) (was: Printing from WindowXP version of emacs), Eli Zaretskii, 2006/01/10
- Re: PostScript printing Latin-N (with N != 1), Reiner Steib, 2006/01/11
- Re: PostScript printing Latin-N (with N != 1), Eli Zaretskii, 2006/01/11
- Re: PostScript printing Latin-N (with N != 1), Reiner Steib, 2006/01/12
- Re: PostScript printing Latin-N (with N != 1), Eli Zaretskii, 2006/01/13
- Re: PostScript printing Latin-N (with N != 1), Reiner Steib, 2006/01/13
- Re: PostScript printing Latin-N (with N != 1), Peter Dyballa, 2006/01/11
- translation software (was: Printing from WindowXP version of emacs), Reiner Steib, 2006/01/05
Re: Printing from WindowXP version of emacs, BRUCE INGALLS, 2006/01/04
Re: Printing from WindowXP version of emacs,
LENNART BORGMAN <=
Re: Printing from WindowXP version of emacs, Ilya Zakharevich, 2006/01/05
Re: Printing from WindowXP version of emacs, LENNART BORGMAN, 2006/01/05