Consulting

Results 1 to 10 of 10

Thread: deleting watermark word 2003

  1. #1

    deleting watermark word 2003

    hello I have a question as I do to clear a watermark without affecting the contents of the header ?, because I have seen several code but all forum delete the header.




    as we all know the marking of water is then inserted into the header as I do to create a macro to delete something specific.




    Thanks in advance for your response and time

    Sub Fecha() 
        ActiveDocument.Sections(1).Range.Select 
        ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader 
         
        Selection.HeaderFooter.Shapes.AddTextEffect( _ 
        PowerPlusWaterMarkObject244368608, "              " & _ 
        Format(Now(), "dd/mm/yyyy"), "Arial", _ 
        1, False, False, 0, 0).Select 
        Selection.ShapeRange.TextEffect.NormalizedHeight = False 
        Selection.ShapeRange.Line.Visible = False 
        Selection.ShapeRange.Fill.Visible = True 
        Selection.ShapeRange.Fill.Solid 
        Selection.ShapeRange.Fill.ForeColor.RGB = RGB(192, 192, 192) 
         
         
         
        Selection.ShapeRange.Fill.Transparency = 0.4 
        Selection.ShapeRange.Rotation = 315 
        Selection.ShapeRange.LockAspectRatio = True 
        Selection.ShapeRange.Height = CentimetersToPoints(6.1) 
        Selection.ShapeRange.Width = CentimetersToPoints(4.34) 
         
         
        Selection.ShapeRange.WrapFormat.AllowOverlap = True 
        Selection.ShapeRange.WrapFormat.Side = wdWrapNone 
        Selection.ShapeRange.WrapFormat.Type = 6 
        Selection.ShapeRange.RelativeHorizontalPosition = _ 
        wdRelativeVerticalPositionMargin 
        Selection.ShapeRange.RelativeVerticalPosition = _ 
        wdRelativeVerticalPositionMargin 
        Selection.ShapeRange.Left = wdShapeCenter 
        Selection.ShapeRange.Top = wdShapeCenter 
         
         
        Selection.ShapeRange.IncrementTop 55 
        ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument 
    End Sub

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    VBA Express does not participate in password hacking and Copy Right infringement schemes
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    This thread is reopened.

    Received by PM from OP

    I have a watermark (dynamic seal, Pepito Perez paid such day 25/10/2015)


    I want to know is how to delete my watermark without affecting the contents of my Documet in Word (logos in the header or footer)


    I put the code you use to set the date to my watermark, was leeyendo the forum and learned how to erase this watermark, the problem is cleared logos Header and Footer


    I really wish I could help because it would be very utilida some code in VBA to expedite that process for now what I do is edit the header by hand and erase the date and watermark
    If I understand, You have documents that you already put the watermark in and now you want to remove the watermark. Is that correct?
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  4. #4
    that's right, I explain my documents (.doc) have a watermark with a dynamic date (current date of edition), after reviews the watermark and date must be removed and then re-edit the documents and place the final version, said final version carries a watermark (is the same) and date again. my question is: is there any way to erase the watermark and date (this income through a macro) used another macro? I say this because I have seen several macro "remove watermark" the problem is that I delete the header and footer, what I want is to just delete the watermark and date use google translator, excuse the bad English, Greetings

  5. #5
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    You want to replace the old watermark with the new watermark?

    use google translator, excuse the bad English, Greetings
    MyMemory - translation is better translator. It has a For Computers button.

    What is your language
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  6. #6
    I want to remove my watermark and date, but without deleting objects in the header or footer, the code I use to delete the watermark is this

    my language is español,

    Sub mai()
    Dim oHF As HeaderFooter
    Dim oSection As section
    Dim Title As String
    Dim Msg As String
    Title = "Borrar Marcas De Agua"
    
    On Error Resume Next
    
    'Show msg - stop if user does not click Yes
    Msg = "Este Macro Borra La Marca de Agua. " & vbCr & vbCr & _
    "Desea Continuar?"
    
    If MsgBox(Msg, vbYesNo + vbQuestion, Title) <> vbYes Then
    Exit Sub
    End If
    
    For Each oSection In ActiveDocument.Sections
            For Each oHF In oSection.Headers
                oHF.Range.Delete
            Next
            For Each oFF In oSection.Footers
                'oFF.Range.Delete
            Next
        Next
    
    End Sub



    the code first place of use to insert the date below my watermark (my_logo.png) image through the insert option word "insert watermark"


    not much VBA programming but my problem is that the code you use erase the entire contents of header and footer, I wanted to know how to delete only what insert for macro (code: Sub Date ()) and I wonder as inserting my watermark (my_logo.png) by macro and place it diagonally

  7. #7
    always I have to update the document where I work so look for ways to delete the watermark and date to place the same date (prior modification of the document)

  8. #8
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Please subir un Documento con el Watermarks.

    click on the "Go Advanced" button to Open the Advanced VBA Express Editor. Antepecho el Advanced Editor is the "Manage Attachements" button para subir el documento
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  9. #9

    Post

    Good evening, after 2 hours reading, learning and revising the forum, learned how to set the date by a variable, then when I want to delete the date instead of using the code to delete all header, specific clear the variable, leave the code in case anyone needs

    Sub AddFechaWaterMark()
    Dim strWMName As String
    ActiveDocument.Sections(1).Range.Select
     strWMName = ActiveDocument.Sections(1).Index
     ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
     
     Selection.HeaderFooter.Shapes.AddTextEffect( _
     PowerPlusWaterMarkObject244368608, "              " & _
     Format(Now(), "dd/mm/yyyy"), "Arial", _
     1, False, False, 0, 0).Select
     Selection.ShapeRange.TextEffect.NormalizedHeight = False
     Selection.ShapeRange.Line.Visible = False
     Selection.ShapeRange.Fill.Visible = True
     Selection.ShapeRange.Fill.Solid
     Selection.ShapeRange.Fill.ForeColor.RGB = RGB(192, 192, 192)
    
       Selection.ShapeRange.Name = strWMName
     Selection.ShapeRange.Fill.Transparency = 0.4
     Selection.ShapeRange.Rotation = 315
     Selection.ShapeRange.LockAspectRatio = True
     Selection.ShapeRange.Height = CentimetersToPoints(6.1)
     Selection.ShapeRange.Width = CentimetersToPoints(4.34)
    
     Selection.ShapeRange.WrapFormat.AllowOverlap = True
     Selection.ShapeRange.WrapFormat.Side = wdWrapNone
    Selection.ShapeRange.WrapFormat.Type = 6
     Selection.ShapeRange.RelativeHorizontalPosition = _
    wdRelativeVerticalPositionMargin
     Selection.ShapeRange.RelativeVerticalPosition = _
     wdRelativeVerticalPositionMargin
    Selection.ShapeRange.Left = wdShapeCenter
     Selection.ShapeRange.Top = wdShapeCenter
    
    Selection.ShapeRange.IncrementTop 55
     ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
    End Sub
    Sub DeleteFechaWaterMark()
    
        Dim strWMName As String
         
        On Error GoTo ErrHandler
         
        ActiveDocument.Sections(1).Range.Select
        strWMName = ActiveDocument.Sections(1).Index
        ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
        Selection.HeaderFooter.Shapes(strWMName).Select
        Selection.Delete
        ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
         
        Exit Sub
         
         
    ErrHandler:
        MsgBox "An error occured trying to remove the watermark." & Chr(13) & _
        "Error Number: " & Err.Number & Chr(13) & _
        "Decription: " & Err.Description, vbOKOnly + vbCritical, "Error"
         
    End Sub



    Samt: Annex to the document, a question to finish my custom watermark will say how can I do to insert an image as a watermark placed using VBA, in the same way that the annex to the just that using VBA


    the truth is an excellent forum I hope to open a section for people who speak Spanish xD haha
    Attached Files Attached Files

  10. #10
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •