PDA

View Full Version : deleting watermark word 2003



newcodeboy
10-25-2015, 08:15 AM
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

SamT
10-25-2015, 08:35 AM
VBA Express does not participate in password hacking and Copy Right infringement schemes

SamT
10-25-2015, 04:09 PM
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?

newcodeboy
10-25-2015, 04:25 PM
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

SamT
10-25-2015, 04:56 PM
You want to replace the old watermark with the new watermark?


use google translator, excuse the bad English, Greetings

MyMemory - translation (http://mymemory.translated.net/) is better translator. It has a For Computers button.

What is your language

newcodeboy
10-25-2015, 05:25 PM
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

newcodeboy
10-25-2015, 05:28 PM
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)

SamT
10-25-2015, 06:03 PM
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

newcodeboy
10-25-2015, 06:45 PM
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

SamT
10-26-2015, 08:39 AM
Tengo: Non English Help (http://www.vbaexpress.com/forum/forumdisplay.php?74-Non-English-Help)