Posts tagged as office
Duplex Printing With Two Sides Per Page
2010-09-29 by , tagged as
Save the following code with a .hta extension and run. Yeah, I know, really advanced error handling. But who cares? It works for me ;-)
<html>
<head>
<title>Two Pages/Sheet Duplex Printing</title>
<HTA:APPLICATION
ID="DuplexPrinting"
APPLICATIONNAME="DuplexPrinting"
SCROLL="no"
SINGLEINSTANCE="yes"
WINDOWSTATE="normal"
>
</head>
<SCRIPT Language="VBScript">
' Program Start
Sub Window_onLoad
window.resizeTo 450,400
End Sub
'Displays formatted information in a new window
Sub RunScript
intPageCount = NumberOfPagesToPrint.Value
If ( intPageCount < 5 ) or ( not IsNumeric( intPageCount ) ) Then WScript.Quit 0 End If
intStart = intPageCount
intEnd = intPageCount
If ( intPageCount Mod 2 = 0 ) Then
REM Page count is even
If ( intPageCount / 2 ) Mod 2 = 0 Then
REM All pages will be fully printed
intEnd = intPageCount - 3
intStart = intPageCount - 5
strLastRun = intPageCount - 1 & "-" & intPageCount
Else
REM Last Page of first run shoult not be used as first page for last run --> skip it
strIntermediateStep = "Remove last page (top most) from stack"
intEnd = intPageCount
intStart = intPageCount - 7
strLastRun = intPageCount - 3 & "-" & intPageCount - 2
End If
Else
REM Page count is odd
If ( ( intPageCount + 1 ) / 2 ) Mod 2 = 0 Then
REM Single page on second side
strLastRun = intPageCount - 4 & "-" & intPageCount - 3
intStart = intPageCount - 8
strPostfix = ""
REM Add Intermediate Step - otherwise two pages would be printed on first sheet
strIntermediateStep = intPageCount
Else
REM Single page on first side
intEnd = intPageCount - 4
strLastRun = intPageCount - 2 & "-" & intPageCount - 1
intStart = intPageCount - 6
strPostfix = ", " & intPageCount
REM Remove last page - otherwise a blank first second side of first sheet would appear
strIntermediateStep = "Remove last page from stack"
End If
End If
REM Create First Run =============
strFirstRun = "1-2"
For i = 5 to intEnd Step 4
strFirstRun = strFirstRun & ", " & i & "-" & i + 1
Next
strFirstRun = strFirstRun & strPostfix
REM ==============================
REM Create First Run =============
For i = intStart to 3 Step -4
strLastRun = strLastRun & ", " & i & "-" & i + 1
Next
REM ==============================
BasicTextArea.Value = strFirstRun & vbCrLf & vbCrLf & strIntermediateStep & vbCrLf & vbCrLf & strLastRun
End Sub
</SCRIPT>
<body>
<div align="center">
<p>Please enter the number of pages you will be printing:
<p>
<input type="text" name="NumberOfPagesToPrint" size="10">
<input id=calculatebutton class="button" type="button" value="Calculate" name="calculate_button" onClick="RunScript">
</p><p>
<textarea name="BasicTextArea" rows="15" cols="50" style="border:none; " readonly="readonly">
</p>
</div>
</body>
</html>
Microsoft Word and Open Office Envelope Printing
2009-12-14 by , tagged as
Again this is ment as a quick reminder.
Printing envelopes is a lot of fun these days since office software does all the required steps automagically. Anway, you should know the envelope size and indentations of sender and recipient adresses. And since I usually cannot find a ruler here is my setup for Microsoft word and Open Office:
Envelope: C6 11,4 x 16,2 cm (A4 folded along and acros)
