Ask Your Question

Removing all draw objects from a writer doc?

asked 2017-02-27 00:21:49 +0200

ticotexas gravatar image

Is there a basic macro that can delete all draw objects from a document? I found one that can delete graphic objects, but I can't figure out how to modify it to delete draw objects.

that macro is here:

edit retag flag offensive close merge delete


Thank you Lupp. That works perfect! Someone else helped with a way to delete all graphics, images, and draw objects where I asked here:

ticotexas gravatar imageticotexas ( 2017-02-27 02:04:34 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2017-02-27 01:13:04 +0200

Lupp gravatar image

A Writer document has one DrawPage. You can enumerate the objects inserted into the DrawPage, among them those creatable with the help of the drawing tools, and make distinctions based on some property. All the "draw objects" should support the service "" I suppose. (The SupportsService function is case sensitive!) A raw sketch:

Sub clearDrawPageFromShapes
theDrawPage = ThisComponent.DrawPage
theEnum = theDrawPage.CreateEnumeration
Do While theEnum.HasMoreElements 
    theElement = theEnum.NextElement
    If theElement.SupportsService("") Then
    End If
End Sub
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-02-27 00:21:49 +0200

Seen: 909 times

Last updated: Feb 27 '17