I'm trying to get Document Authors (Created By) Email Id using SPMetal generated class code.
DocumentCreatedBy as one of the Sharepoint Foundation Base field.
When I try to get
LoginName from that field I'm getting the following error:
Value does not fall within the expected range
Here is my code...
DocumentsDocument docItem SPFieldUserValue usrValue = new SPFieldUserValue(web, docItem.DocumentCreatedBy); //I tried this too...But no luck....:( //SPFieldUserValue usrValue = new SPFieldUserValue(web, "Created_x0020_By"); SPUser docUser = usrValue.User; var usrEmail = docUser.LoginName;