Using Excel VBA: Deleting Blank Pages on a Word Document if an Event Occurs -
so i'm trying on open word document using excel vba, i'm trying go through each page of word document , if length of range on page less or equal 20 (20 being length of subtitle bookmarked , page break performed, leaving blank page , 20 character spaces) delete page holds no content.
the following have right now, doesnt work.
dim rng range, long = 1 wddoc.computestatistics(wdstatisticpages) set rng = wddoc.goto(what:=wdgotopage, name:=i) set rng = rng.goto(what:=wdgotobookmark, name:="\page") if len(rng) <= 20 rng.delete next
Comments
Post a Comment