Суперскрипты в PPT из XL - PullRequest
       19

Суперскрипты в PPT из XL

0 голосов
/ 14 декабря 2011

Я пытаюсь создать слайды из XL, но мне бросают вызов сноски. Я хочу заполнить раздел сносок несколькими сносками, в то время как каждая строка начинается с надстрочного числа. Может кто-нибудь сказать мне, как я могу это сделать?

Я пробовал некоторые решения, которые нашел в Интернете, но я не могу просто надписать один символ.

Спасибо за вашу помощь

с

1 Ответ

0 голосов
/ 29 декабря 2011

Нечто подобное должно начать вас; код написан для запуска с PPT, и вам понадобятся некоторые моды для его запуска из Excel:

Dim oSl As Slide
Dim oSh As Shape
Dim oPres As Presentation
Dim x As Long

' for example purposes, we'll do this IN PPT
' and use the current presentation
Set oPres = ActivePresentation

' and we'll work with slide 1
Set oSl = oPres.Slides(1)

' rather than using PPT's own footnotes, I'd simply
' add my own text box ...
Set oSh = oSl.Shapes.AddTextbox(msoTextOrientationHorizontal, 10, 500, 500, 50)

' and work with it ...
With oSh
    ' add your text:
    .TextFrame.TextRange = "1One line of text" & vbCrLf _
        & "2Two lines of text, the second a bit longer" & vbCrLf _
        & "3New we are three lines of text"

    ' subscript the first character of each line up to 9
    On Error Resume Next    ' in case there are fewer lines
    For x = 1 To 9
        .TextFrame.TextRange.Paragraphs(x).Characters(1, 1).Font.Superscript = True
    Next
    ' and the first two characters of each line past that
    For x = 10 To .TextFrame.TextRange.Paragraphs.Count
        .TextFrame.TextRange.Paragraphs(x).Characters(1, 2).Font.Superscript = True
    Next
End With
...