Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am trying to develop a quick label making program that allows a user to scan in a machine's serial number, MAC Address, and Part number; and then generate a custom barcoded label with all three pieces of data printed on it. I thought this would be fairly easy... basically use a batch script to prompt the user to scan in the data, "echo" out an .rtf document, and then invoke "write /p 'myfile.rtf'" to print the label automatically on the label printer (set as default printer). This seems to work fine for the process, but the rtf file is not being printed using the settings stated within the rtf file itself. Rather, I needed to change both the default printer settings as well as go into wordpad and change the page setup settings as well in order for the labels to be printed correctly. If, however, I open the rtf file in Word (from Windows instead of through a batch script), the settings from the document seem to be correct (ie the scale adjusts to the paper-size as specified in the .rtf file instead of using the default paper-size). Is there a way to ensure that when the batch file opens the document in Wordpad, that it retains the correct settings? Or is there a difference between Word and Wordpad that might be causing this issue (I'd rather use Wordpad since not all of the systems that would use this script have Word installed)?
There are 10 different kinds of people in this world. Those that know binary, and those that don't.

Hi Pyth007.
I've been having the same problems with RTF/Wordpad. It seems bizare that Microsoft own the RTF format and yet their RTF reader doesn't read RTF properly.
Anyway, the page margin info for Wordpad is held in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Wordpad
I don't know much about batch files, but if you're able to write to the registry then that could be the answer. Don't forget to set the units too, just in case.As for the page size, I'm still working on that, but if you come up with anything else, I'd be glad to hear about it. From what I can gather, letter is the default page size in RTF.
Regards
Matt

![]() |
Can't get file to work in...
|
Change reg query output
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |