Creating a watermark in Excel with VBA

– Selva V Pasupathy, HSBC Global Resourcing, Hyderabad

    ActiveSheet.Shapes.AddTextEffect(PresetTextEffect:=2, _
              Text:="DRAFT", FontName:="Arial Black", FontSize:=36, _
              FontBold:=False, FontItalic:=False, Left:=50, Top:=150).Select

    With Selection.ShapeRange
         .ScaleHeight 1.23, False
         .ScaleWidth 1.6, False
    
         ' Solid or no color
         .Fill.Visible = False                     ' Hide any colors
         .Fill.Transparency = 0.5                  ' semi-transparent
         
         ' Outline
         .Line.Weight = 0.75                       ' Line weight outline (1.25 is darker)
         .Line.DashStyle = 1                       ' Use a solid line
         .Line.Style = 1                           ' use continuous, I am guessing
         .Line.Transparency = 0#                   ' Make the line semi-transparent
         .Line.Visible = True                      ' show the line
         .Line.ForeColor.SchemeColor = 12          ' line color is blue
         .Line.BackColor.RGB = RGB(255, 255, 255)
    
         .Height = 80                              ' expand the height of the text
         .Width = 400                              ' expand the width of the text
    End With

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: