In PowerPoint 2010/2013, how to keep watermark alw

2019-08-06 02:56发布

问题:

I am using a small VBA program to apply some text in the background. I am able to apply watermark but if I use any image in the presentation then the watermark goes behind that image. Is there any way to keep the watermark always in front. I am using this code to apply watermark :

Dim cntDesigns As Integer
cntDesigns = ActivePresentation.Designs.Count

For iter = 1 To cntDesigns
    Dim curDesign As Design
    Set curDesign = ActivePresentation.Designs.Item(iter)

    ' EnumerateMasters
    Dim masterCount As Integer  
    masterCount = 1
    Dim masters(100) As Master
    Set masters(masterCount) = curDesign.SlideMaster

    Dim cntLayouts As Integer
    cntLayouts = curDesign.SlideMaster.CustomLayouts.Count
    For Layout = 1 To cntLayouts
        Dim curLayout As CustomLayout
        Set curLayout = curDesign.SlideMaster.CustomLayouts(Layout)

        If curLayout.DisplayMasterShapes = msoFalse Then
            masterCount = masterCount + 1
            Set masters(masterCount) = curLayout
        End If
    Next Layout

    For masterIter = 1 To masterCount
         Dim shape As shape
        Set shape = masters(masterIter).Shapes.AddTextbox(msoTextOrientationHorizontal, 0#, 0#, 100#, 100#)
        shape.TextEffect.Text = "Watermark"
        shape.Height = 100
        shape.Width = 100
        shape.TextFrame2.WordWrap = msoTrue
        shape.TextFrame2.WarpFormat = msoWarpFormat1
        shape.Left = 100
        shape.Top = 200

    Next masterIter
Next iter

回答1:

No, anything you put on top of something will cover it up. There's no "Keep this shape on top" command.

You can, however, trap one or more events that are likely to happen often (selection change, for example) and let that event trigger code that looks at each shape on the slide(s) and moves your watermark shape to front if it's not already there.