Options

EXISTS not working as expected

doddwelldoddwell Member Posts: 65
Hello
I have a text variable containing the UNC path to a file and that I pass to the HYPERLINK function and this opens the file as expected. I want to alter the code so that it first checks that the file exists before attempting to open it. To do this, I pass the same text variable to the EXISTS function but this does not find the file. Any suggestions? Thanks. Sample code below.

UNCPath := '\\servername\sharename\filename.tif';
IF EXISTS(UNCPath) THEN
HYPERLINK(UNCPath)
ELSE
ERROR('Cant find file');


Many Thanks

Best Answer

Answers

Sign In or Register to comment.