F
Felix
I need to delete an entire page based on the presence of a text string. I
tried using the code i found in the following post:
Deleting a page based on text search 6/18/2007 11:52 AM PST by Damo
'_______________________________________
Dim strSearch As String
Dim rgeStart As Range
Set rgeStart = Selection.Range
strSearch = "Subject Teacher :" & Chr(13)
With ActiveDocument.Range.Find
.Text = strSearch
Do While .Execute
With .Parent
.Select
With Selection
.Bookmarks("\Page").Range.Delete
.Characters(1).Delete
End With
End With
Loop
End With
rgeStart.Select
Application.Browser.Target = wdBrowsePage
'_______________________________________
I get a compile error on .bookmarks
Any ideas?
tried using the code i found in the following post:
Deleting a page based on text search 6/18/2007 11:52 AM PST by Damo
'_______________________________________
Dim strSearch As String
Dim rgeStart As Range
Set rgeStart = Selection.Range
strSearch = "Subject Teacher :" & Chr(13)
With ActiveDocument.Range.Find
.Text = strSearch
Do While .Execute
With .Parent
.Select
With Selection
.Bookmarks("\Page").Range.Delete
.Characters(1).Delete
End With
End With
Loop
End With
rgeStart.Select
Application.Browser.Target = wdBrowsePage
'_______________________________________
I get a compile error on .bookmarks
Any ideas?