Deleting pictures from 4D Write Pro documents

Automatically translated from English

4D Write Pro brings good news with 4D v18 R2: deleting inline or anchored pictures can now be done in a snap! Say hello to the new command, WP DELETE PICTURE.

HDI: Delete 4DWP pictures 

So how to proceed? Simply retrieve the picture you want to delete by its ID (using WP Get element by ID) or by its position (using WP Get elements), then call the command. Voilà!

Delete picture by its ID

$pictRef:=WP Get element by ID(WParea;"Logo")
WP DELETE PICTURE($pictRef)

Delete all inline pictures from the header

$header:=WP Get header(WParea;1)
$_pictures:=WP Get elements($header;wk type image)
For each ($pictRef;$_pictures)
  WP DELETE PICTURE($pictRef)
End for each

More examples can be found in the HDI above and the full documentation can be read here!

Roland Lannuzel

• Product Owner & 4D Expert •

After studying electronics, Roland went into industrial IT as a developer and consultant, building solutions for customers with a variety of databases and technologies. In the late 80’s he fell in love with 4D and has used it in writing business applications that include accounting, billing and email systems.

Eventually joining the company in 1997, Roland’s valuable contributions include designing specifications, testing tools, demos as well as training and speaking to the 4D community at many conferences. He continues to actively shape the future of 4D by defining new features and database development tools.