tex/ppt_printout_ps.vbs
author Shingo W. Kagami
Sun, 19 Sep 2010 05:55:48 +0900
changeset 5 105778ace30a
parent 4 8b90d57759c9
permissions -rw-r--r--
Have ppt_printout_ps.vbs take the printer name as an argument.
Misc. changes in Makefile.sample.
     1 Dim printer
     2 Dim filein
     3 Dim fileout
     4 If WScript.Arguments.Count <> 3 then
     5    WScript.quit
     6 End If
     7 printer = WScript.Arguments.item(0)
     8 filein = WScript.Arguments.item(1)
     9 fileout = WScript.Arguments.item(2)
    10 
    11 Dim pptApp
    12 Dim pptPres
    13 Set pptApp = Wscript.CreateObject("PowerPoint.Application")
    14 pptApp.Visible = True
    15 Set pptPres = pptApp.Presentations.Open(filein)
    16 
    17 With pptPres.PrintOptions
    18  .RangeType = ppPrintAll
    19  .NumberOfCopies = 1
    20  .PrintHiddenSlides = msoTrue
    21  .PrintColorType = ppPrintColor
    22  .FitToPage = msoFalse
    23  .FrameSlides = msoFalse
    24  .ActivePrinter = printer
    25  .PrintInBackground = False 
    26 End With
    27 pptPres.PrintOut , , fileout
    28 
    29 Dim i
    30 Dim note
    31 For i = 1 To pptPres.Slides.Count
    32   Wscript.StdErr.Write "Processing slide " & i & "... "
    33   note = pptPres.Slides(i).NotesPage.Shapes(2).TextFrame.TextRange
    34   WScript.StdOut.WriteLine note
    35   WScript.StdOut.WriteLine Chr(12)
    36   If InStr(note, "@file=") > 0 Then
    37     pptPres.Slides(i).Export filein & ".tmp_slide" & i & ".png", "PNG"
    38   End If
    39   Wscript.StdErr.WriteLine "done"
    40 Next
    41 
    42 pptPres.Close
    43