ppt_printout_ps.vbs
changeset 0 2bb9df67c0fe
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ppt_printout_ps.vbs	Sun Sep 19 13:16:17 2010 +0900
     1.3 @@ -0,0 +1,43 @@
     1.4 +Dim printer
     1.5 +Dim filein
     1.6 +Dim fileout
     1.7 +If WScript.Arguments.Count <> 3 then
     1.8 +   WScript.quit
     1.9 +End If
    1.10 +printer = WScript.Arguments.item(0)
    1.11 +filein = WScript.Arguments.item(1)
    1.12 +fileout = WScript.Arguments.item(2)
    1.13 +
    1.14 +Dim pptApp
    1.15 +Dim pptPres
    1.16 +Set pptApp = Wscript.CreateObject("PowerPoint.Application")
    1.17 +pptApp.Visible = True
    1.18 +Set pptPres = pptApp.Presentations.Open(filein)
    1.19 +
    1.20 +With pptPres.PrintOptions
    1.21 + .RangeType = ppPrintAll
    1.22 + .NumberOfCopies = 1
    1.23 + .PrintHiddenSlides = msoTrue
    1.24 + .PrintColorType = ppPrintColor
    1.25 + .FitToPage = msoFalse
    1.26 + .FrameSlides = msoFalse
    1.27 + .ActivePrinter = printer
    1.28 + .PrintInBackground = False 
    1.29 +End With
    1.30 +pptPres.PrintOut , , fileout
    1.31 +
    1.32 +Dim i
    1.33 +Dim note
    1.34 +For i = 1 To pptPres.Slides.Count
    1.35 +  Wscript.StdErr.Write "Processing slide " & i & "... "
    1.36 +  note = pptPres.Slides(i).NotesPage.Shapes(2).TextFrame.TextRange
    1.37 +  WScript.StdOut.WriteLine note
    1.38 +  WScript.StdOut.WriteLine Chr(12)
    1.39 +  If InStr(note, "@file=") > 0 Then
    1.40 +    pptPres.Slides(i).Export filein & ".tmp_slide" & i & ".png", "PNG"
    1.41 +  End If
    1.42 +  Wscript.StdErr.WriteLine "done"
    1.43 +Next
    1.44 +
    1.45 +pptPres.Close
    1.46 +