Word 2002 Section formatting Macro Problem

B

Brian Canavan

Hi Folks

I am using Word 2002 on an XP machine. I am preparing templates that may be
used by Word 2000 users also.

Essentially what I want to do is have a macro button for the user to use to
insert a new section in the doc and have a new watermark (part of our
company logo) appear in the bottom right of the page. I have tried
inserting the graphic as an auto text but it always inserts in the previous
section.

I am using a table in the header (from the previous section) but want the
watermark to appear outside this in the new section. (Hence the messy
character count in the macro) I have also tried toggling off the "same as
previous" in the header toolbar while recording the macro.

A copy of my recorded macro is below:

Sub AppendixSection()
'
' AppendixSection Macro
' Macro recorded 13/07/2004 by bjcanavan
'
Selection.InsertBreak Type:=wdSectionBreakNextPage
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.LinkToPrevious = Not Selection.HeaderFooter. _
LinkToPrevious
Selection.MoveRight Unit:=wdCharacter, Count:=6
NormalTemplate.AutoTextEntries("BullenB").Insert Where:=Selection.Range,
_
RichText:=True
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
NormalTemplate.AutoTextEntries("Appendices").Insert
Where:=Selection.Range _
, RichText:=True
End Sub


Any help or advicce you can give gratefully received.

Regards

Brian
 
M

Margaret Aldis

Hi Brian

I usually handle this by storing the section break containing special page
orientation/headers, and with section *not* linked to previous, as AutoText.
To do that, get a section set up as you want it, then select the section
break (easiest to do by placing cursor before it, then holding down shift
and pressing right arrow once), then Insert > AutoText and Add the item to
the correct template.

The method then simplifies to:

Insert a section break to 'protect' the mark the end of the current page
format.
In the section after the break, unset 'same as previous' on headers and
footers - that makes sure the following section won't inherit your special
header (you can leave footers linked if they do flow through).
Insert the AutoText entry.

See the end of

http://www.syntagma.demon.co.uk/Articles/WordWorkaround2.pdf

for a more detailed explanation and some code to do the unlinking.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Watermark macro 3
Macro error 5941 1
Error using Macro recording 0
Debug Macro in Word 2007 3
Update fields in footers 2
Macro assitance for Letterhead 2
VB runtime error 5941 Help 3
Bookmark problem 0

Top