Ctrl + Shift + P 혹은 F1을 눌러서 Developer: Insepct Editor Tokens and Scopes 를 연다. 그리고 태그를 지정할 부분을 클릭해서 scope가 될 이름을 찾을 수 있다. 아래의 예제에서는 keyword.control.tag-name.djangostorage..... 어쩌구로 이어지는데 이 부분을 기억한다.
이후에 아래의 그림처럼 대상이 될 Theme를 찾아서 json 파일을 연다. 이 과정은 알아서 찾아야 한다.
아랫 부분을 찾아보면 위와 같은 내용이 써있을텐데 임의로 항목을 하나 만들어서 name은 적당한 걸 지정해주고 위 그림처럼 scope 부분에 내가 적용하고 싶은 항목을 적으면 된다. 하위 항목에 전부 적용되므로 keyword.control.tag-name 까지만 입력하였다. 적용되는 설정은 settings 부분에서 foreground 나 background 를 입력하면 된다.
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