Provides tools for converting date and time formats, for obtaining information from user names, for modifying access to sites, and for various other tasks in managing deployments of Microsoft SharePoint Foundation.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
The following code example iterates through the collection of document discussions for a document library and uses the SendEmail method of the SPUtility class to send email notification to a specified address if the total number of comments made about a document is more than 20.
Dim site As SPWeb = SPControl.GetContextWeb(Context) Dim Msg As String = "" Dim discs As SPDocDiscussionCollection = site.GetDocDiscussions("Document_Library_Name") Dim disc As SPDocDiscussion For Each disc In discs If disc.CommentCount > 20 Then Msg = "The file <A href='" & disc.DocUrl.ToString() _ & "'>" + disc.DocUrl.ToString() & "</A> has received " _ & disc.CommentCount.ToString() & " comments." SPUtility.SendEmail(site, False, False, "Email_Address", "Web Discussion Report", Msg) End If Next disc