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