Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2006

Tip: Looking for answers? Try searching our database.

How to detect a certain break in a document.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rVo - 14 Apr 2006 11:22 GMT
I'm trying to replace all breaks of the type wdSectionBreakOddPage by
wdSectionBreakContinuous but I have no idea how to do this. Normally I would
look for the ascw-codes they leave in the document and create a simple
find-replace-all to do the job, but for these breaks it doesn't work as they
all get code chrw(13)

Could anyone tell me how to replace these breaks easily?

Thanks in advance.

rVo
Shauna Kelly - 14 Apr 2006 12:34 GMT
Hi rVo

Don't think about the break; think about the section.

Try something like this (untested):

dim oSec as Word.Section

   for each oSec in ActiveDocument.Sections
       oSec.PageSetup.SectionStart = wdSectionContinuous
   next oSec

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> I'm trying to replace all breaks of the type wdSectionBreakOddPage by
> wdSectionBreakContinuous but I have no idea how to do this. Normally I
[quoted text clipped - 9 lines]
>
> rVo
Helmut Weber - 14 Apr 2006 13:03 GMT
Hi "rVo",

>all get code chrw(13) ???

chr(12)!

the kind of break is defined not only by the character itself
but by pagesetup.sectionstart in addition.

Replacing is not what you are looking for.
You have to change pagesetup.sectionstart.

See:

http://groups.google.de/group/microsoft.public.word.vba.general/browse_frm/threa
d/ff2b378d13a5807a/8f3673505ecd3cd9?lnk=st&q=chr(12)+group%3Amicrosoft.public.wo
rd.vba.general+author%3AHelmut+author%3AWeber&rnum=2&hl=de#8f3673505ecd3cd9


Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.