Prevent overwrite file

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
User avatar
bvdbos
Posts: 11
Joined: Sun Jul 13, 2008 9:07 am
Location: Helmond, Netherlands

Prevent overwrite file

Post by bvdbos »

On Oooforum Villeroy gave a sample code to prevent overwriting documents by a macro. However, aren't the properties of StoreAsUrl meant for this:

Code: Select all

   Dim FileProperties(0) As New com.sun.star.beans.PropertyValue
FileProperties(0).Name = "Overwrite"
 FileProperties(0).Value = False
 oDoc2.StoreAsURL(ConvertToURL(bestand),FileProperties())
?

What's the difference, the latter doesn't seem to work?
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Prevent overwrite file

Post by Villeroy »

I don't know what property "Overwrite" is meant for. Can you tell us what it does and why it does not seem to work? Whats wrong with my code, which justs test for existance and raises a MsgBox askin for what to do if file exists?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply