tex/ppt_printout_ps.vbs
changeset 4 8b90d57759c9
child 5 105778ace30a
equal deleted inserted replaced
-1:000000000000 0:506bf8383bc9
       
     1 Dim filein
       
     2 Dim fileout
       
     3 If WScript.Arguments.Count <> 2 then
       
     4    WScript.quit
       
     5 End If
       
     6 filein = WScript.Arguments.item(0)
       
     7 fileout = WScript.Arguments.item(1)
       
     8 
       
     9 Dim pptApp
       
    10 Dim pptPres
       
    11 Set pptApp = Wscript.CreateObject("PowerPoint.Application")
       
    12 pptApp.Visible = True
       
    13 Set pptPres = pptApp.Presentations.Open(filein)
       
    14 
       
    15 With pptPres.PrintOptions
       
    16  .RangeType = ppPrintAll
       
    17  .NumberOfCopies = 1
       
    18  .PrintHiddenSlides = msoTrue
       
    19  .PrintColorType = ppPrintColor
       
    20  .FitToPage = msoFalse
       
    21  .FrameSlides = msoFalse
       
    22  .ActivePrinter = "Generic PostScript Writer"
       
    23  .PrintInBackground = False 
       
    24 End With
       
    25 pptPres.PrintOut , , fileout
       
    26 
       
    27 Dim i
       
    28 Dim note
       
    29 For i = 1 To pptPres.Slides.Count
       
    30   Wscript.StdErr.Write "Processing slide " & i & "... "
       
    31   note = pptPres.Slides(i).NotesPage.Shapes(2).TextFrame.TextRange
       
    32   WScript.StdOut.WriteLine note
       
    33   WScript.StdOut.WriteLine Chr(12)
       
    34   If InStr(note, "@file=") > 0 Then
       
    35     pptPres.Slides(i).Export filein & ".tmp_slide" & i & ".png", "PNG"
       
    36   End If
       
    37   Wscript.StdErr.WriteLine "done"
       
    38 Next
       
    39 
       
    40 pptPres.Close
       
    41