Prev: How do I alter default to turn off superscript for numbers, dates
Next: Exportasfixedformat - selective pages only
From: andreas on 21 Dec 2009 04:19 On 21 Dez., 00:35, Jay Freedman <jay.freed...(a)verizon.net> wrote: > On Sun, 20 Dec 2009 14:17:42 -0800 (PST), andreas > > <andreas.her...(a)gmx.de> wrote: > >Dear Experts: > > >I would like to know whether it is possible to retrieve the number of > >even-page section breaks in the current document and display the > >result in a MsgBox? > > >Help is much appreciated. Thank you very much in advance. > > >Regards, Andreas > > Sub CountEvenPageSectionBreaks() > Dim oSec As Section > Dim EvenCount As Long > > For Each oSec In ActiveDocument.Sections > If oSec.PageSetup.SectionStart = wdSectionEvenPage Then > EvenCount = EvenCount + 1 > End If > Next > > MsgBox EvenCount & " Even Page section break(s)" > End Sub > > -- > Regards, > Jay Freedman > Microsoft Word MVP FAQ:http://word.mvps.org > Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. Dear Jay, thank you very much for your terrific help. It works as desired. Regards, Andreas
From: Greg Maxey on 21 Dec 2009 07:55
You are welcome. Like Jay, I haven't ever intentionally set the first section to start as an even page either. I just wasn't sure if you were really looking for the number of sections that starts with an even page or the physical breaks. "andreas" <andreas.hermle(a)gmx.de> wrote in message news:99d6d686-d87c-4cb3-963f-f86e83faa943(a)j4g2000yqe.googlegroups.com... On 21 Dez., 01:18, Greg Maxey <gma...(a)gmail.com> wrote: > On Dec 20, 6:35 pm, Jay Freedman <jay.freed...(a)verizon.net> wrote: > > > > > > > On Sun, 20 Dec 2009 14:17:42 -0800 (PST), andreas > > > <andreas.her...(a)gmx.de> wrote: > > >Dear Experts: > > > >I would like to know whether it is possible to retrieve the number of > > >even-page section breaks in the current document and display the > > >result in a MsgBox? > > > >Help is much appreciated. Thank you very much in advance. > > > >Regards, Andreas > > > Sub CountEvenPageSectionBreaks() > > Dim oSec As Section > > Dim EvenCount As Long > > > For Each oSec In ActiveDocument.Sections > > If oSec.PageSetup.SectionStart = wdSectionEvenPage Then > > EvenCount = EvenCount + 1 > > End If > > Next > > > MsgBox EvenCount & " Even Page section break(s)" > > End Sub > > > -- > > Regards, > > Jay Freedman > > Microsoft Word MVP FAQ:http://word.mvps.org > > Email cannot be acknowledged; please post all follow-ups to the > > newsgroup so all may benefit. > > Hi Jay, > > I was toying with something similar when your post appeared. If the > first section starts as a even page section I wander if it should be > counted as break? > > Sub CountEvenPageSectionBreaks() > Dim i As Long > Dim Cnt As Long > 'start with section 2 > For i = 2 To ActiveDocument.Sections.Count > If ActiveDocument.Sections(i).PageSetup.SectionStart = > wdSectionEvenPage Then > Cnt = Cnt + 1 > End If > Next > MsgBox Cnt > End Sub- Zitierten Text ausblenden - > > - Zitierten Text anzeigen - Hi Greg, thank you very much for your looking into this matter a little deeper. It works just fine. Regards, Andreas |