먼저 각 글 머리 기호 항목은 단락 (실제로는 TextRange2
)이므로 의 Paragraphs
에 대한 참조를 가져옵니다.
Private Function SetIndent(ByVal level As Integer, ByRef p As TextRange2)
p.ParagraphFormat.IndentLevel = level
p.ParagraphFormat.FirstLineIndent = 40
p.ParagraphFormat.LeftIndent = level * 40
End Function
:
Dim pres As Presentation
Set pres = Application.ActivePresentation
Dim slide As slide
Set slide = pres.Slides(2)
Dim shapes As shapes
Set shapes = slide.shapes
Dim textShape As Shape
Set textShape = shapes(2)
Dim textFrame As TextFrame2
Set textFrame = textShape.TextFrame2
Dim textRng As TextRange2
Set textRng = textFrame.textRange
Dim p As TextRange2
Set p = textRng.Paragraphs
SetIndent 1, p.Item(1)
SetIndent 2, p.Item(2)
SetIndent 2, p.Item(3)
SetIndent 1, p.Item(4)
마지막 네 줄은 글 머리 기호 및 텍스트의 스타일에 영향을 미치는 "수준"들여 쓰기를 설정하는 로직을 캡슐화하는 기능과 총알의 실제 들여 쓰기 및 텍스트를 호출
들여 쓰기 요소를 전달하는 것과 같이 필요에 맞게 리팩토링 할 수는 있습니다 (단, 40으로 하드 코딩했지만 마일리지가 다를 수 있음).
출처
2010-05-20 02:08:06
Jay
감사합니다. 작동합니다. –