GroupDocsGists
10/19/2017 - 11:07 AM

Documents-AddWatermarkUsingCellsShapeSettings.vb

' For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
Using doc As CellsDocument = Document.Load(Of CellsDocument)(Utilities.MapSourceFilePath(FilePath))
    Dim watermark As New TextWatermark("Test watermark", New Font("Segoe UI", 19))
    Dim shapeSettings As New CellsShapeSettings()

    ' Set the shape name
    shapeSettings.Name = "Shape 1"

    ' Set the descriptive (alternative) text that will be associated with the shape
    shapeSettings.AlternativeText = "Test watermark"

    ' Editing of the shape in Excel is forbidden
    shapeSettings.IsLocked = True

    doc.AddWatermark(watermark, shapeSettings)


    doc.Save()
End Using