View Single Post
 
Old 08-18-2019, 07:09 PM
Visor Visor is offline Windows 10 Office 2013
Advanced Beginner
 
Join Date: Aug 2019
Posts: 38
Visor is on a distinguished road
Default

Greetings, thanks for the solution you give me, and it works perfect, but I was inconvenienced that when I assign the text to the bookmark, it is added more and more, therefore I have seen the need for the document to close delete the bookmark so that when the document is opened again it is created and the text is assigned that works but is added. In other words, the Bookmark is deleted but the text is not deleted. Then the other way would be to search for the text and replace with nothing ""
But the macro does not work.

Well, I think this is another issue. Practically with that I would have the document finished, I would prefer to send it so you can take a look and give me the definitive help.
As they say, I'm having the wonderful thing.

HTML Code:
Sub eliminarMiBM()
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
'    ActiveDocument.Sections(1).headers (wdHeaderFooterPrimary)
    If ActiveDocument.Bookmarks.Exists("NombreEncab") = True Then
   ActiveDocument.Bookmarks("NombreEncab").Delete
    End If
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

'If ActiveDocument.Bookmarks.Exists("NombreEncab") = True Then
' 'ActiveDocument.Bookmarks("NombreEncab").Select
' ActiveDocument.Bookmarks("NombreEncab").Delete
' End If
End Sub

HTML Code:
Sub DelTexHeader()
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
'ActiveDocument.Sections(1).headers(wdHeaderFooterPrimary).Range
    'ActiveWindow.ActivePane.View.NextHeaderFooter
    ActiveDocument.Find.ClearFormatting
    ActiveDocument.Find.Replacement.ClearFormatting
    With ActiveDocument.Find
        .Text = "Name Here"
        .Replacement.Text = ""
    End With
    'Selection.Find.Execute
    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub
If you approve that I send you the complete document, I would like you to tell me.
Reply With Quote