How to check the absence of any "includetext" fields in document?

F

fokrogh

I have written a event macro that adjust tables and removes
tabulators
in the word document.

How can i make the macro check the absence of any "includetext"
fields
in the document before the macro adjust tables and removes
tabulators?


Regards


Frank
___________________________


Private Sub Document_Close()


Application.ScreenUpdating = False


Selection.HomeKey Unit:=wdStory
For Each aTable In ActiveDocument.Tables
aTable.AutoFitBehavior (wdAutoFitContent)
Next aTable


Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = vbTab
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll


Selection.HomeKey Unit:=wdStory
Application.ScreenUpdating = True


End Sub
 
J

Jay Freedman

Answered in the vba.general newsgroup. Please don't post the same question
separately in different newsgroups, as it just leads to wasted effort.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top