0

I'm creating an Excel file (.xlsb) each day and upload it manually to SharePoint. It always puts the file under document type 'Description' in SharePoint. But I want it under Document type 'Report'.

Does someone have a piece of VBA code that sets the SharePoint Document type to 'Report' (or any other doc type) in the newly created XLSB file?

I learned how to set a document property in an XLSB but I can't find the right property that does the trick for the SharePoint doc type. If I

  • change the files property in SharePoint (edit properties) and set the doc type to e.g. 'Report' (annoying)
  • download that file from SharePoint
  • change it, and...
  • upload it to SharePoint again, ...it'll put it into the right document type section in SharePoint

But as I create a new file every day I'd like to set the SharePoint doc type directly.

Any ideas?

update 14-Nov-2019: I gave it another shot and - HEY! - it works with...

Function setDocumentType()
Dim prop            As Object

    For Each prop In ThisWorkbook.ContentTypeProperties
        If prop.name = "Document Type" Then
            prop.Value = "JoesTestDocType"
        End If
    Next prop
End Function

... as a first attempt. Or ...

ThisWorkbook.ContentTypeProperties.Item("Document Type") = "JoesDocType"
Joe Phi
  • 340
  • 1
  • 4
  • 14
  • 1
    Possible duplicate of [Set Sharepoint Tags/Properies with VBA](https://stackoverflow.com/questions/19449653/set-sharepoint-tags-properies-with-vba). – Pᴇʜ May 03 '19 at 07:51
  • No, I learned how to set a document property (actually [this one](https://stackoverflow.com/questions/14863250/how-to-add-a-documentproperty-to-customdocumentproperties-in-excel/14863333#14863333) did it) in an XLSB but I can't find the right property that does the trick for the SharePoint doc type. What am I missing/ doing wrong? – Joe Phi May 03 '19 at 08:25

0 Answers0