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