Hello everyone!
Will someone be kind and help me with a VBA code, I am new into this and want to learn.
Is there a way to delete a Microsoft Word Document table/page by giving a specific keyword by creating a VBA in Excel? I am asking this because I am working in a Music Store and we have to get rid of some table/page in Multiple Word Documents, and I guess it would be easier by a VBA in Excel (by searching for a given text and delete), rather than copy pasting the VBA in each Word.
I found this on SOF https://stackoverflow.com/questions/...-specific-text
but seems to work only in Word VBA.
Can someone help? Thank you in advance
Below is what I've tried so far, but unfortunately it doesen't do anything after searching the word "Solo", so that's wrong and it is not what I want. Perhaps what my code is missing is to jump (goTo) to the table once the text was found then to delete as below
With .Find
.Forward = False
.ClearFormatting
.MatchWholeWord = True
.MatchCase = True
.Wrap = wdFindContinue
.Text = "Solo"
.Execute
If .Execute = True Then
Table.delete
End If
End With
Best,
John