07-15-2013 08:18 AM - edited 07-15-2013 08:23 AM
Hi,
I am looking for a way to not overwrite a file when I use the SaveAs2 method in Labview. Currently it overwrites any existing file with that name and I would like for it to do the usual append a number of sometype to the filename if it already exists.
Thanks
Solved! Go to Solution.
07-15-2013 08:29 AM
Hi Gus
Where is this method located? Could you upload a code snippet or VI which demonstrates the problem?
Kind Regards
07-15-2013 08:39 AM
I attached two screenshots of the code.
07-15-2013 08:41 AM
The second picture is where I use the SaveAs2 method, my goal is to save the word document as a .pdf which works great. It's just that it overwrites any file with the same name, where I would rather it didn't do that.
07-15-2013 08:53 AM
Hi Gus
If you check here: http://msdn.microsoft.com/en-us/library/microsoft.office.tools.word.document.saveas(v=vs.80).aspx
(MSDN reference for the ActiveX call) You can see that the expected behaviour of this call is to "If a document with the specified file name already exists, the document is overwritten without the user being prompted first." Since this is as Microsoft intended, and external to LabVIEW this can't be changed.
What we can change is how we use the control. I.e. you could use the Check if File or Folder exists VI with a case structure to modify the file name input if the file already exists?
Kind Regards
07-15-2013 08:56 AM
Alright, thanks.