Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Tue, 27 May 2008 04:23:00 -0700,    group: microsoft.public.word.vba.customization        back       


macro to create and mnipulate sections in word   
Hello everyone.
 
I need to create a macro that:
1. open a new section in the middle of the document, so the first section 
will be section 1, the second section section 2, and the third section 
section 3.
 
2. Changes the layout of section2 to - landscape.
3. Deletes the footers of section 2 and section 3 (and not of section1).
 
I have succeeded to create this manually, but when I'm trying to make a 
macro from this, I cant get the footers right...
 
Please Help me!!
date: Tue, 27 May 2008 04:23:00 -0700   author:   iris

Re: macro to create and mnipulate sections in word   
Use when the cursor is located where you want to insert the first section 
break.:

Selection.InsertBreak wdSectionBreakNextPage
Selection.InsertBreak wdSectionBreakNextPage
ActiveDocument.Sections(2).PageSetup.Orientation = wdOrientLandscape
For i = 2 To 3
    With ActiveDocument.Sections(i)
        With .Footers(wdHeaderFooterFirstPage)
            .LinkToPrevious = False
            .Range.Delete
        End With
        With .Footers(wdHeaderFooterPrimary)
            .LinkToPrevious = False
            .Range.Delete
        End With
    End With
Next i

-- 
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"iris"  wrote in message 
news:0E97228A-46EA-4C9C-8B0B-2487988CA31C@microsoft.com...
> Hello everyone.
>
> I need to create a macro that:
> 1. open a new section in the middle of the document, so the first section
> will be section 1, the second section section 2, and the third section
> section 3.
>
> 2. Changes the layout of section2 to - landscape.
> 3. Deletes the footers of section 2 and section 3 (and not of section1).
>
> I have succeeded to create this manually, but when I'm trying to make a
> macro from this, I cant get the footers right...
>
> Please Help me!!
>
date: Wed, 28 May 2008 08:27:56 +1000   author:   Doug Robbins - Word MVP

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us