[Solved] Removing all draw objects from a writer doc?

Keyboard macros or custom scripts

[Solved] Removing all draw objects from a writer doc?

Postby ticotexas » Mon Feb 27, 2017 1:21 am

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: http://askubuntu.com/questions/259704/h ... ice-writer
Last edited by Hagar Delest on Mon Feb 27, 2017 9:10 am, edited 1 time in total.
Reason: tagged [Solved].
ticotexas
 
Posts: 4
Joined: Tue Nov 09, 2010 5:40 pm

Re: Removing all draw objects from a writer doc?

Postby robleyd » Mon Feb 27, 2017 1:47 am

Cross posted from AskLibreOffice

OP - are the details in your signature up to date?
Cheers
David
Apache OpenOffice 420m2(Build:9821) - Slackware 14.2 - 64 bit
LibreOffice 6.4.6.2 (SlackBuild for 6.4.6 by Eric Hameleers) - Slackware 14.2 - 64 bit
Apache OpenOffice 4.1.4 - Windows 7 Virtual machine
User avatar
robleyd
Moderator
 
Posts: 3950
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Removing all draw objects from a writer doc?

Postby musikai » Mon Feb 27, 2017 2:09 am

This will delete ALL graphics:

Code: Select all   Expand viewCollapse view
sub deleteallGraphics
go = ThisComponent.DrawPage
     For i = go.Count-1 to 0 step -1
       g = go.getByIndex(i)
       g.dispose
     next i
end sub
Win7 Pro, Lubuntu 15.10, LO 4.4.7, OO 4.1.3
Free Project: LibreOffice Songbook Architect (LOSA)
http://struckkai.blogspot.de/2015/04/libreofficesongbookarchitect.html
musikai
Volunteer
 
Posts: 282
Joined: Wed Nov 11, 2015 12:19 am

Re: Removing all draw objects from a writer doc?

Postby ticotexas » Mon Feb 27, 2017 2:57 am

musikai wrote:This will delete ALL graphics:


Wow, thanks! That's perfect. I appreciate the help.
ticotexas
 
Posts: 4
Joined: Tue Nov 09, 2010 5:40 pm


Return to OpenOffice Basic, Python, BeanShell, JavaScript

Who is online

Users browsing this forum: No registered users and 2 guests