小编Joh*_*mbe的帖子

如何从Libreoffice Calc工作簿的所有工作表中删除所有图像

我有一本Libreoffice Calc工作簿,其中有60多张纸,其中许多纸上都印有沉重的图像。我想使用Calc Basic宏删除所有图像。我尝试了以下失败,并显示基本运行时错误Property or method not found: Pictures.

Sub DeleteAllPics()
    Dim Pic As Object
    For Each Pic In ThisComponent.CurrentController.ActiveSheet.Pictures
       Pic.Delete
Next Pic
End Sub
Run Code Online (Sandbox Code Playgroud)

我还尝试了以下操作,但由于基本运行时错误而失败 Object variable not set.

Sub deleteAllPics()
    Dim wkSheet As Object
    For Each wkSheet In ThisWorkbook.ThisComponent.Sheets.getByName()
        Dim Pict As Object
        For Each Pict In wkSheet
            Pict.Delete
        Next Pict
    Next wkSheet       
End Sub
Run Code Online (Sandbox Code Playgroud)

以下代码将从Libreoffice Writer文档的所有页面中删除所有图片:

   Sub RemoveImages
       Dim oDoc as Object
       oDoc = ThisComponent
       Dim oGraphics as Object
       oGraphics = oDoc.getGraphicObjects()
       Dim oImg as Object
       For …
Run Code Online (Sandbox Code Playgroud)

libreoffice libreoffice-calc

1
推荐指数
1
解决办法
1202
查看次数

标签 统计

libreoffice ×1

libreoffice-calc ×1