26 | 04 | 2017

VisibleVisual.com | Word VB Articles

Delete all blank pages

The code below deletes all blank pages within a word document.

Sub DeleteEmptyPages(ByVal Worddoc As Word.Document)
With Worddoc.Content.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = ChrW(12)
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchWildcards = True
    .Execute Replace:=wdReplaceAll
End With
End Sub
Login

Sign up now and upload your code to the website.

Help us to continue.....
Statistics
Articles View Hits
2234891
Latest Articles