我有一個包含許多部分的大型 PowerPoint 檔案,我會不斷添加一些部分。
我正在尋找一種按字母順序對我的部分進行排序的方法。
我確信使用 VBA 是可行的,但我的知識有限,我找不到類似的代碼來適應。
非常感謝你的幫助!
uj5u.com熱心網友回復:
這是基于經典的陣列排序邏輯 - 但適用于部分。
如果您有很多部分,不知道這是否是性能問題。
Sub sortSections()
Dim sp As SectionProperties
Set sp = ActivePresentation.SectionProperties
Dim cntSections As Long
cntSections = sp.Count
Dim i As Long, j As Long
For i = 1 To cntSections - 1
For j = i 1 To cntSections
If UCase(sp.Name(i)) > UCase(sp.Name(j)) Then
sp.Move j, i
End If
Next
Next
End Sub
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/315662.html
