GetAttr

Returns an integer that represents the attributes of a file or folder.

Syntax
      GetAttr (path)

Key
   path  The path to the file/folder.

The GetAttr() function may be used in VBA or in an SQL query (VBConstants can only be referenced in VBA code).

GetAttr will return one or a combination of the following values:

VBConstant Value Explanation
vbNormal 0 Normal
vbReadOnly 1 Read-only
vbHidden 2 Hidden
vbSystem 4 System file
vbDirectory 16 Directory or folder
vbArchive 32 File has been changed since last backup
vbAlias 64 File name is an alias

Example

Dim intDemo as integer

intDemo = GetAttr ("C:\docs\demo.doc")

“If you are planning for a year, sow rice; if you are planning for a decade, plant trees; if you are planning for a lifetime, educate people” ~ Chinese Proverb

Related:

Int - Return the integer portion of a number.


© Copyright SS64.com 1999-2014
Some rights reserved