21 | 08 | 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
    .Text = ChrW(12)
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchWildcards = True
    .Execute Replace:=wdReplaceAll
End With
End Sub

Sign up now and upload your code to the website.

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