none
SharePoint document index - not indexing custom columns RRS feed

  • Question

  • Hello,

    With the help of various posts and tutorials across the internet I have created an excel file that indexes a document library on SharePoint.

    The file names, modified dates, size and location all come through perfectly. However, I created two custom columns in the library "VersionNo" and "Owner" which I can't pull into the excel file. I have searched everywhere for an answer to this but just can't find one!

    Here is my script:

    Dim iRow
    
    Sub ListFiles()
        iRow = 7
        Call ListMyFiles(Range("B2"), "TRUE")
    End Sub
    
    Sub ListMyFiles(mySourcePath, IncludeSubfolders)
        Set MyObject = New Scripting.FileSystemObject
        Set mySource = MyObject.GetFolder(mySourcePath)
        On Error Resume Next
        For Each myFile In mySource.Files
            iCol = 2
            Cells(iRow, iCol).Value = myFile.Name
            iCol = iCol + 1
            Cells(iRow, iCol).Value = myFile.VersionNo
            iCol = iCol + 1
            Cells(iRow, iCol).Value = myFile.DateLastModified
            iCol = iCol + 1
            Cells(iRow, iCol).Value = myFile.Path
            iCol = iCol + 1
            Cells(iRow, iCol).Value = myFile.Size
            iRow = iRow + 1
        Next
        If IncludeSubfolders Then
            For Each mySubFolder In mySource.SubFolders
                Call ListMyFiles(mySubFolder.Path, True)
            Next
        End If
    End Sub
    
    

    Thanks in advance for any contribution!

    Tuesday, September 18, 2012 11:51 AM

All replies

  • Why could I not do something like:

    Const VERSIONNO As String = "{5e58edf6-960a-453d-9384-ed6e5235eb28}"

    And then call myfile.VERSIONNO?

    I feel like this should really be a simple problem that I am having, predefined columns are importing fine

    Wednesday, September 19, 2012 9:34 AM