![]() |
#1
|
|||
|
|||
![]()
I created a macro to select text from a Word document and insert it into a footer by recording key strokes and mouse clicks. It's failing when pasting the selected text into the footer. Does anyone know what's wrong?
Selection.HomeKey Unit:=wdStory Selection.EndKey Unit:=wdLine, Extend:=wdExtend Selection.Cut WordBasic.ViewFooterOnly ActiveDocument.AttachedTemplate.BuildingBlockEntri es(" Blank").Insert _ Where:=Selection.Range, RichText:=True Selection.PasteAndFormat (wdPasteDefault) |
#2
|
||||
|
||||
![]()
Hi TessaLee,
Try something along the lines of: Code:
Sub AddFooter() ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Text = Selection.Text End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
TessaLee | Word | 1 | 03-15-2011 04:14 AM |
![]() |
WalterinOz | Word | 1 | 12-22-2010 11:08 PM |
Different Header but same Footer | Karthick | Word | 1 | 11-12-2010 09:08 AM |
Filename in footer | Dixon | Word | 3 | 09-24-2009 09:12 AM |
Header and footer questions | boutells | Word | 0 | 07-21-2009 01:57 AM |