Hey everybody,
Laserfiche Support did an SCR for my current issue, but I wanted to try to workaround it with a script. I repurposed a script from the Code Library that iterates through annotations in an entry isolates a particular type and deletes them (like deleting all sticky notes or stamps from an entry). So I have figured it all out, except for what integer to set for 'no fill' background. I tried -1, 0, 255, 256, and 'Nothing'. at best I get black background. Anyone know what I might can use to indicate 'no fill' for the background in a script? Script is below: (the line in question is 41)
Namespace WorkflowActivity.Scripting.SDKScript
'''<summary>
'''Provides one or more methods that can be run when the workflow scripting activity is performed.
'''</summary>
Public Class Script1
Inherits SDKScriptClass90
'''<summary>
'''This method is run when the activity is performed.
'''</summary>
Protected Overrides Sub Execute()
' *** Remove Annotation(s) script starts here. ***
' Retrieve the document, lock it, then retrieve the document's annotations (of a specified type).
Dim Doc As LFDocument = Me.Entry
Doc.LockObject(Lock_Type.LOCK_TYPE_WRITE)
Dim AnnListing As ILFAnnotationListing = Doc.GetAllAnnotations(Annotation_Type.ANN_TEXTBOX) ' <-- Change annotation type, if necessary.
' Determine if the document has 1+ annotations (of a specified type).
If AnnListing.RowCount > 0 Then
' Get the document's pages and create a LFPage object.
Dim Pages As LFDocumentPages = Doc.Pages
Dim Page As LFPage
' Create a variable that will determine which page is set to be processed next.
Dim NextPageToBeProcessed as Integer = 0
' Process each row of AnnListing.
For i As Integer = 1 To AnnListing.RowCount
' Get the annotation's page number.
Dim AnnotationPageNumber As Integer = AnnListing.DatumByColType(i, Annotation_Column.ANNOTATION_COLUMN_PAGE_NUM)
' Get the page on which the annotation exists.
Page = Pages.Item(AnnotationPageNumber)
' Get the annotation's ID.
Dim AnnotationID As Integer = AnnListing.DatumByColType(i, Annotation_Column.ANNOTATION_COLUMN_ITEM_ID)
' Get the annotation.
'Dim Ann As ILFAnnotation = Page.GetAnnotationByID(AnnotationID)
Dim tb as ILFTextboxAnnotation = Page.GetAnnotationByID(AnnotationID)
' Change its color.
tb.FillColor = 256
' Determine if we are processing AnnListing's last row.
If i <> AnnListing.RowCount Then
' Determine which page is set to be processed next.
NextPageToBeProcessed = AnnListing.DatumByColType(i + 1, Annotation_Column.ANNOTATION_COLUMN_PAGE_NUM)
' Update all changes made to the page if we're done processing it.
If NextPageToBeProcessed <> AnnotationPageNumber Then
' Update the page.
Page.Update()
End If
Else
' If we are processing AnnListing's last row, update the page now.
Page.Update()
End If
Next
End If
' Unlock the document and release it from memory.
Doc.Dispose()
' *** Remove Annotation(s) script ends here. ***
End Sub
End Class
End Namespace