Is txt file read-only?

  • Thread starter Thread starter karlroes
  • Start date Start date
K

karlroes

Hi all,

Using Len(Dir$(txtFileName)) to check if a file exists, can anyone
suggest an additional step to check the Read-Only status of the same
file?

Thanks in advance.

Karl
 
Hi Karl

If GetAttr( txtFileName ) and vbReadOnly Then
' file is read-only
End If

Look up the online help for GetAttr to find how other file attributes can be
checked.

You can also change file attributes using SetAttr.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top