SolidWorks PDM Macro - Delete a File

Hello

I can't find the command to run on a PDM macro to delete a file.

I tried this, with filepath as the full file name declared as String. (e.g. C:/**********/test.pdf)

Kill filepath

 

The goal is to copy a pdf into another folder, then delete the source file. I manage to copy the pdf to another folder, with another name but impossible to find how to delete the source file...

Does anyone know how to do it?

Thank you in advance!

Hello

Solution 1: See HERE.

Solution 2: See HERE.

Kind regards

Hello d.roger,

Thank you for your answer! I had already found these explanations, but without understanding why it didn't work... In a momentum, I replaced my line of code:

folder. DeleteFile(0, file.ID, True)

by:

folder. DeleteFile 0, file.ID, True

I don't know why, but the parentheses given in the SolidWorks solution don't work.

Thanks again in any case! ;)