Created 9 22 04 Modified 09 30 04

The Word Page Setup Page


1.  What does this page mean to me?
2.  Why did you do this?
3.  How does it work?
4.  What versions of Windows and Word does it work on?
5.  Where can I get the utility and instrucations?
6.  What are the Page Setup Options in the Wordpage configuration file?
7.  I'd like to adjust the FirstPageTray and OtherPagesTray setting
8.  I'd like to download some of these files
9.  I'd like to see some links to more information



1.  What does this page mean to me?

This page has been provided for you to help automate the changing of page setup options in multiple Word files
Kudos to Luis Oliveros of Canon Canada for doing all of the work on the php code for this utility


2.  Why did you do this?

By default, Word documents save page setup options like paper source, margins and orientation
Word documents formated for one particular printer often need to be adjusted for a different printer
Doing this by hand for each Word document takes time.
We wanted to create a simple tool to perform this automatically

3.  How does it work?
Pretty good  :-)
We have a self contained Windows executable called PHP.EXE and related files
A simple PHP script is edited and a command line PHP command is executed.
The result is the opening, editing and saving of all word documents in a target directory
It is assumed this action is performed on a Windows workstation with the applicable version of Word installed


4.  What versions of Windows and Word does it work on?
We've tried Windows XP SP1/Word 2002, Windows 2000 SP4/Word 2000, and Windows  NT4/Word 97
We have not verified how well it works under all other variations of OS and Word versions
It would be wise to use the information on this page on a backup copy of your Word documents and not your only source.


5.  Where can I get the utility and instrucations?

Download the utility from here
For simplicity, decompress the utility close to the root of the drive (I'll assume c:\wordpage)
Put the Word documents you wish to edit (a copy of them is wise) in c:\wordpage\docs
Read and edit the configuration file wordpage.php with a text editor of your choice. Place or remove the # symbol (remark) to disable or enable any desired setting
In a Windows command shell, CD to the wordpage directoy (cd wordpage)
Finally execute the utility with the following context
php.exe wordpage.php c:\wordpage\docs
Hopefully all will go well
Open your edited Word documents and verify the Page Setup options are satisfactory


6.  What are the Page Setup Options in the Wordpage configuration file?

Since this is a work in progress the following information will be modified as we learn more

$f->TopMargin = 72;             #Sets the Top margin to 1 inches
$f->BottomMargin = 72;        #Sets the Bottom margin to 1 inches
$f->LeftMargin = 108;           #Sets the Left margin to 1.5 inches
$f->RightMargin = 108;         #Sets the Right margin to 1.5 inches
$f->HeaderDistance = 36;     #Sets the Header distance from edge to 0.5 inches
$f->FooterDistance = 36;      #Sets the Footer distance from edge to 0.5 inches
$f->Gutter = 0;                      #Sets the Gutter size to 0 inches
$f->FirstPageTray =X ;          #Sets the First Page paper tray.  0=Default Tray (Auto Select) The value word X depends on your printer, see 7. below
$f->OtherPagesTray = Y;      #Sets the Other Pages paper tray 0=Default Tray (Auto Select) The value word Y depends on your printer, see 7. below
$f->PaperSize = 2;               #Sets the paper size (2=Letter 3=Lettersmall 4=Legal 5=Executive 6=A3 7=A4 23=Tabloid)
$f->Orientation = 0;             #Sets the page orientation 0=Portrait 1=Landscape


7.  I'd like to adjust the FirstPageTray and OtherPagesTray setting
The value words for FirstPageTray and OtherPagesTray depends on the printer you are using
One solution to find the correct value word is simply through experimentation.  IE Adjust FirstPageTray =X, run the wordpage tool and see the change made to the paper source settings in Word

Another solution is to use a tool we created from the Microsoft Knowledge Base Article - 194789 - Determine Available PaperBins with DeviceCapabilities API
List-bins.exe provides a Windows GUI interface to get the locally installed printer driver bin value words.
You can get list-bins.exe from here

../images/list-bins.png


8.  I'd like to download some of these files

File
Description
list-bins.zip
Included list-bins.exe.  A Windows executable to get the local printer driver bin Value Words
list-bins.txt
The value words for the Canon PCL5 6.51 PCL6 4.40 PS3 2.3 and a few PS 2.1 drivers
wordpage.zip
Contains the Windows PHP executable and configuration files for automatic Word Page Setup


9.  I'd like to see some links to more information
Even more VBA details can be found here




Home           Back

If you find an error or wish to comment please let me know