Files Property Example

This example retrieves all of the properties of a file and concatenates the META tags into a string with a pipe ("|") delimiter separating the data.

Note   The PropertyKeys shown in this example apply to a web created with the One Page Only Web Wizard. Other templates may use other PropertyKeys.

Private Sub GetFileProperties()
Dim myFiles As WebFiles
Dim myFile As WebFile
Dim myAuthor As String
Dim myModifiedBy As String
Dim myTimeCreated As String
Dim myTimeLastModified As String
Dim myFileSize As String
Dim myTitle As String
Dim myMetaTags As Variant
Dim myMetaTag As Variant
Dim myProgID As Variant
Dim myGenerator As String
Dim myTimeLastWritten As String
Dim myProperties As Properties
Dim myMetaTagList As String

Set myFiles = ActiveWeb.Rootfolder.Files

For Each myFile In myFiles
    Set myProperties = myFile.Properties
    
    myAuthor = myAthor & myProperties("vti_author") _
        & "|"
    myModifiedBy = myModifiedBy & _
        myProperties("vti_modifiedby) & "|"
    myTimeCreated = myTimeCreated & _
        myProperties("vti_timecreated") & "|"
    myTimeLastModified = myTimeLastModified & _
        myProperties("vti_timelastmodified") & "|"
    myFileSize = myFileSize & _
        myProperties("vti_FileSize) & "|"
    myTitle = myTitle & myProperties("vti_title") _
        & "|"
    myProgID = myProgID & myProperties("vti_title") _
        & "|"
    myGenerator = myGenerator & _
        myProperties("vti_generator") & "|"
    myTimeLastWritten = myTimeLastWritten & _
        myProperties("vti_timelastwritten") & "|"
    myMetaTags = myProperties("vti_metatags")
    For Each myMetaTag In myMetaTags
        myMetaTagList = myMetaTagList & myMetaTag & "|"
    Next
Next
End Sub