-
Feb 13th, 2019, 01:32 PM
#1
Thread Starter
Fanatic Member
Removing page breaks from a Word document using Vb6
Trying to remove all page breaks from a Word document
Code:
Private Sub RemovePageBreaks()
Dim Rng As Range
oWrdAppNew.ActiveDocument.Activate
Set Rng = ActiveDocument.Range.GoTo(What:=wdGoToPage, Name:=1)
Set Rng = Rng.GoTo(What:=wdGoToBookmark, Name:="\page")
Rng.End = Rng.End - 2
Rng.Collapse wdCollapseEnd
If Asc(Rng.Characters.Last) = 12 Then Rng.Delete
ActiveDocument.Range.InsertAfter "Ah!"
End Sub
The last word "Ah" verifies that I am writing to the desired document (ie it is the correct one being activated).
EL84 is not pointer to nationality, but a miniature output valve (tube), B9A, similar to the much larger octal 6V6, and popular in guitar amps
-
Feb 13th, 2019, 03:08 PM
#2
Thread Starter
Fanatic Member
Re: Removing page breaks from a Word document using Vb6
EL84 is not pointer to nationality, but a miniature output valve (tube), B9A, similar to the much larger octal 6V6, and popular in guitar amps
-
Feb 13th, 2019, 03:09 PM
#3
Thread Starter
Fanatic Member
Re: Removing page breaks from a Word document using Vb6
I've just made it work. I changed Rng.End = Rng.End -2 to Rng.End = Rng.End -1
But I have no idea why that fixed it!
EL84 is not pointer to nationality, but a miniature output valve (tube), B9A, similar to the much larger octal 6V6, and popular in guitar amps
-
Feb 14th, 2019, 04:28 PM
#4
Thread Starter
Fanatic Member
Re: Removing page breaks from a Word document using Vb6
Sorry. That last post turned out to be wrong. It IS -2!
EL84 is not pointer to nationality, but a miniature output valve (tube), B9A, similar to the much larger octal 6V6, and popular in guitar amps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|