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