【发布时间】:2017-07-18 15:36:12
【问题描述】:
环顾四周,没有找到。需要一个宏,以便我可以在我拥有的 695 个不同文件上重复 695 次。文档有点不安,或者我不走运。
我可以在 Microsoft VBA 中这样做:
Sub VbaBlackies
Dim oSl As Slide
For Each oSl In ActivePresentation.Slides
With oSl
.FollowMasterBackground = msoFalse
.DisplayMasterShapes = msoFalse
With .background
.Fill.ForeColor.RGB = RGB(0, 0, 0)
.Fill.BackColor.RGB = RGB(0, 0, 0)
End With
End With
Next oSl
End Sub
我正在 LibreOffice BASIC 中寻找类似的东西。我可以这样开始编写代码:
Sub Main
Dim oDoc As Object
Dim oDPages As Object
Dim oDPage As Object
oDoc= ThisComponent
oDPages = oDoc.getDrawPAges()
For i=0 To oDPages.count()-1
oDPage = oDPages.getByIndex(i)
oDPage.Background = RGB(0,0,0) 'This does not work.
'I have no idea on how to access the object's properties and alter them.
Next i
End Sub
有什么想法吗?
【问题讨论】:
-
记录手动更改的宏。这可能会给你你需要的代码。
-
试过了,但是 Impress 不记录宏。
-
录制了一个宏在Calc中执行类似的操作,改变了单元格的背景颜色。给了我一些提示,但在获取 Slide 对象的“框架”引用时遇到了麻烦。
标签: vba libreoffice libreoffice-impress