Excel: How to get a locale-independent printer name? - excel-2003

There's a PrintOut method in Excel that prints stuff.
It accepts a printer name as a parameter, and that printer name is not just a system printer name, but a combination of both system printer name and port to which the printer is connected.
.PrintOut ActivePrinter:="MyPrinter" & " on " & "Ne00:"
If you only provide a system name, Excel will not find it and will not print.
Note that " on " piece in the middle. It is actual English word "on" that makes "excel printer name" human-friendly.
The problem is, this little piece is different on each localised version of Excel. Therefore, code that wants to compose true "excel printer name" would need to include a huge switch where all possible Excel locales would be listed with corresponding translation of "on". I haven't even got such list. But I would like to have it, or to hear about a way to figure out this piece on the fly. The Application.International property does not seem to contain an answer.

This guy uses the registry entries at
\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices\
http://www.dailydoseofexcel.com/archives/2008/04/05/getting-the-printer-port/

You can first read the ActivePrinter property. It will return the string as per the locale. Once you have the string, you can get what exact version of "on" to use!

Related

How can I set a hotkey in atom (using their keymap perhaps) to print a string?

I am coding and there is a long string that i cant be asked to type out every time i need to. How could I set a shortcut?
example_coding.bla(bla.bla) *starts typing long string*
Then it recognises the start of my long string so gives me the option to press tab and auto insert the rest of it?
This is using LaTeX in Atom, but would be great if it could be for any coding language.
I know you're asking for how to create a command, but it sounds like what you really want is a snippet. Since you haven't provided any information about your use case, I can't tell you what to put in your snippets.cson, but the Flight Manual has all the necessary information.

automatically route print jobs to different printer based on filename / job name

What would be a good method to automatically route print jobs to different printers based on the printed filename?
It looks like Ricoh Print and Share may be able to do it though I haven't tried... they categorize the tool as a "virtual printer driver", but, in general it seems that we would just want to insert some program between the system print interface and the actual printer. So, the term 'print filter' seems like it might be relevant also.
Thoughts?
UPDATE: RedMon looks interesting. See here.

In transaction NACE, is it possible to find out the print program and form routine, if i know the name of the Smartform?

I want to find out the name of the Print Program, and the name of the subroutine (form) that prints my SmartForm.
Now luckily in NACE (Conditions for Output Control), one can "kinna" figure out the application and the output type by oneself, and then the print program is obviously written there.
So what about if one wouldn't know what application and Output Type, and would have to check all applicatios and output types manually? isn't there an easier way to do this?
The table TNAPR contains some print program -> script links, search for your smartform name in field SFORM. This is by no means an exhaustive list, however.
OR
Do a "where used" search for "SSF_FUNCTION_MODULE_NAME", which will give you a list of all smartform calling programs. You'd still need to go through it manually, but you might find a suitably matching program description or similar.
If you need to find out the actual printing program for a certain form and it is possible to get a print preview, you can always enter the debugger using /h and examine the call stack.

Delphi - How I tell the system what printer to use?

To print the contents of a TRichEdit I use
RichEdit.Print('My Document Name');
Some times I need to print it on "printer1" other times I need to print it on "printer2"
Question:
How I tell the system what printer to use ?
You set the Printer.PrinterIndex. As documented, setting '-1' sets to the default printer, and the Printers property contains a list of installed printers.

extract text from word or pdf based on format (font name and size)

I need to parse large text (about 1000 pages of word or pdf document)and place some of the text inside this document into database fields
I found that the only thing I can distinguish the text I want to extract is the format , it is always "Helvetica-Condensed" size 12
can I do that ? I know how to use the string functions but what I should use to test the format ?
as I said the text is stored inside word document or PDF
if there is third party component can do no problem please refer it to me
Thanks
There is QuickPDF. The price is $249,00.
The other option is to code it yourself. The file specification is available online, and if your only trying to rip the text out of the document this should guide you most of the way.
The only thing to be careful of are documents which are built entirely from images. In that scenario (no matter what you use to read the file) you will also need an OCR type of application. To see if this is the case or not, open a sample of the type of file you are wanting to "extract" text from, select the text to copy then try to paste into notepad.

Resources