Dear all,
Do any of your know how to delete a page form a word document using VB Code.
Thank alot
EricLun
Printable View
Dear all,
Do any of your know how to delete a page form a word document using VB Code.
Thank alot
EricLun
Possibly.
You could try looking at recording what happens when you manually delete the page then translating to code. Pls note that its best not to cut n paste as the selection object is weird when automating. I found out this the hard way.
Vince
MS Word doesn't really think in terms of pages. This is should work to delete the current page.
:)VB Code:
Dim rngEnd As Range Dim rngStart As Range Application.Browser.Target = wdBrowsePage Application.Browser.Next Set rngEnd = Selection.Range Application.Browser.Previous Set rngStart = Selection.Range ActiveDocument.Range(rngStart.Start, rngEnd.End).Text = ""