I have a script in DOORS that creates a document with a table. However, for some reason, it always adds 2 empty pages before the actual content. I have been trying to write a simple script that will delete these first 2 pages, but it's not working. Here's the code I'm using:
Code:
Sub removeExtraPages()
Dim Rng As Range, iPage As Long
iPage = 2
With ActiveDocument
Set Rng = .GoTo(What:=wdGoToPage, Name:=iPage)
Set Rng = Rng.GoTo(What:=wdGoToBookmark, Name:="\page")
Rng.Delete
End With
End Sub
I found this code from this forum, but can't seem to figure out what is causing the problem. I'm hoping someone can help me out.
Chris