#
일괄변환 프로그램이나 사이트는 많다.
하지만 이미지가 이리저리 깨지는 경우가 생김.
파워포인트로 열고, 그 안에서 pdf로 내보내기 하면 정상.
파워포인트 내에서는 일괄적으로 변환하기 어렵다.
파워포인트 매크로를 이용해서 폴더안에 있는 pptx 파일을
파워포인트를 통해서 한번에 pdf 로 내보내기 할 수 있다.
날짜를 입력하고 슬라이드 쇼를 연 다음 버튼을 누르자.
# 혹시 매크로를 보안 문제로 막아놓은 경우 풀고 사용하자.
# code
Sub PPTFilesToPDF()
Dim objPresentaion As Presentation
Dim objSlide As Slide
Dim objTextBox As Shape
Set objPresentaion = ActivePresentation
Set objSlide = objPresentaion.Slides.Item(1)
Set objTextBox = objSlide.Shapes.Item(1)
Dim sFolder As String
Dim sFile As String
Dim ppApp As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
Dim bNewInstance As Boolean
sFolder = objTextBox.TextFrame.TextRange.Text 'change the path accordingly'
If Right(sFolder, 1) <> "\" Then
sFolder = sFolder & "\"
End If
sFile = Dir(sFolder & "*.pptx", vbNormal)
If Len(sFile) = 0 Then
MsgBox "No files found.", vbExclamation
Exit Sub
End If
On Error Resume Next
Set ppApp = GetObject(, "PowerPoint.Application")
If ppApp Is Nothing Then
Set ppApp = CreateObject("PowerPoint.Application")
bNewInstance = True
End If
On Error GoTo 0
Do While Len(sFile) > 0
Set ppPres = ppApp.Presentations.Open(sFolder & sFile)
sFile = Left(sFile, Len(sFile) - 5)
ppPres.ExportAsFixedFormat sFolder & sFile & ".pdf", ppFixedFormatTypePDF, ppFixedFormatIntentPrint
ppPres.Close
sFile = Dir
Loop
If bNewInstance Then _
ppApp.Quit
Set ppApp = Nothing
Set ppPres = Nothing
MsgBox "Completed...", vbInformation
End Sub
21.07.07
화질 저하 이슈에 대해.
ppPres.ExportAsFixedFormat sFolder & sFile & ".pdf", ppFixedFormatTypePDF, ppFixedFormatIntentScreen
웹 저장용 화질 (저화질)
ppPres.ExportAsFixedFormat sFolder & sFile & ".pdf", ppFixedFormatTypePDF, ppFixedFormatIntentPrint
인쇄용 화질(고화질)
필요에 따라 매크로 수정.
파일은 고화질 저화질 선택할 수 있도록 수정했습니다.
'컴퓨터꿀팁' 카테고리의 다른 글
[해결] 윈도우 바탕화면 안뜸 무한 재시작, 원격 프로시저를 실행하지 못했습니다. (0) | 2021.03.01 |
---|---|
한글 Hwp -> pdf 한번에 일괄변환 하는 법 (13) | 2020.12.10 |
pyinstaller 실수 안하는 법 Import Error: cannot import name 'namedtuple' from 'collections' (1) | 2020.09.16 |
마이크로소프트 원노트 윈도우10 버전 (0) | 2020.02.02 |
원노트 페이지 제목 글자 잘림 현상 해결 (0) | 2019.08.26 |