4

when I'm getting all the lists with my Client program from a specific SharePoint server, I'm getting quite a lot of them, but I'd like to present to the user only the Document Libraries. How can I do this? I saw that a Library can be named anything, not only "Shared Documents", so there must be another possibility? I'm currently using WSS/SOAP and talking to the _vti_bin/lists.asmx service with GetListsCollection method, but any clue will be helpful.

Thank you

3 Answers 3

8

Part of the response for each list is the attribute BaseType which is a string representation of the numeric value from the enumeration SPBaseType for each list.

BaseType="1" for DocumentLibrary

0
7

I stumbled upon this question but I was looking for Server Object model code. Below code helped me and maybe will help someone else too.

                if (objList.BaseType == SPBaseType.DocumentLibrary)
                {
                    //Call function
                }
-3

Another way to find List Template type is

objList.BaseTemplate == SPListTemplateType.DocumentLibrary 
1
  • Please check other answers before adding your own.
    – Dinerdo
    Feb 19, 2018 at 22:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.