Page Setup problems using VBA

Page Setup problems using VBA

Post by Adria » Sat, 15 Nov 2003 20:31:08


I have an Access 2000 system running a word 2000 mail
merge document via OLE. The first run of the
document is ok, the next run I get an invalid value error
when trying to access any of the PageSetup properties and
examining the property in the watch window shows a value
of 999999 ? Can anyone help ?

Code posted below

This is where I pick up the application object reference

oleReport.Verb = acOLEVerbOpen
oleReport.Action = acOLEActivate
Set wordobj = Me.oleReport.Object.Application


Then the pagesetup code is

wordobj.Documents(1).Activate
wordobj.Documents
(1).PageSetup.DifferentFirstPageHeaderFooter = True
wordobj.Documents(1).SectionStart = wdSectionContinuous
wordobj.Documents(1).Repaginate


The exact error message is "value out of range", error
number 4608


Thanks
.
 
 
 

Page Setup problems using VBA

Post by Word Heret » Sun, 16 Nov 2003 12:57:17

G'day "Adrian" < XXXX@XXXXX.COM >,

use activedocument.sections(n).page...

"Adrian" < XXXX@XXXXX.COM > was spinning this
yarn:


Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

Replies offlist may require payment.