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
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