1
 $mlField = [SPFieldMultiLineText]$field

I have a field, it is of type field but I want to cast it as SPFieldMultiLineText (I can confirm that this is a valid cast, I'm assuming my syntax is bad).

The error I'm getting:

Unable to find type [SPFieldMultiLineText]: make sure that the assembly containing this type is loaded.

This is a SharePoint Management Console so all relevant SharePoint assemblies are loaded - this is not the issue.

Any pointers in the right direction of making this cast without an error?

Thanks a lot.

EDIT: For a bit more context, this is ultimately what I'm trying to achieve:

http://blogs.msdn.com/b/pavankumar/archive/2008/11/17/how-to-change-a-multi-line-text-field-to-allow-unlimited-length-in-a-document-library.aspx

3
  • 1
    Have you tried with full type name: $mlField = [Microsoft.SharePoint.SPFieldMultiLineText]$field ? Commented Jan 18, 2013 at 11:08
  • Thanks a lot, please post as answer. Commented Jan 18, 2013 at 11:32
  • 1
    Cast comment to answer ;). Thanks! Commented Jan 18, 2013 at 11:36

1 Answer 1

2

Try with full type name:

$mlField = [Microsoft.SharePoint.SPFieldMultiLineText]$field 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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