Hiding a Note problem

I am trying to hide a note but the code isn't working. It finds the note(s) in question, I can change the text and I can get all of the information about it but when I try to set the visibility equal to false it's still there. It looks like the visible property is being set correctly to false. Any help is appreciated.

I've put the code in question below

        Do While Not curView Is Nothing
                '' Now go through all of the notes and hide the quote/proto
               Set theNote = curView.GetFirstNote
              
                Do While Not theNote Is Nothing
                    If InStr(UCase(theNote.GetText), "QUOTATION") <> 0 Then
                        '' Hide the stamp
                       
                        Debug.Print "visible(before)=" & theNote.Visible & " sheet: " & i
                        theNote.Visible = False

                        Debug.Print "visible(after)=" & theNote.Visible
                    End If
                    If InStr(UCase(theNote.GetText), "PROTOTYPE") <> 0 Then
                        '' Hide the stamp
                        theNote.Visible = False
                    End If
                   
                    theDoc.Rebuild (True)
                   
                    Set theNote = theNote.GetNext
                Loop

... it does some other unrelated things after this


Dan

SolidworksApi macros