Property: Attributes for File
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Properties > Property: Attributes for File
Property: Attributes for File
Specifies the attributes of a file.
Object.Attributes
| Object | File Object with this property | |||||||||||||||||||||||||||
| Object.Attributes | Enumeration with read and write access and the following selection terms:
|
The following example removes the write-protection of a file:
Sub MakeWritable(sFile) Dim fso, oMyFile Set fso = CreateObject("Scripting.FileSystemObject") Set oMyFile = fso.GetFile(sFile) If oMyFile.Attributes and 1 Then oMyFile.Attributes = oMyFile.Attributes - 1 End If End Sub