|
-
Jul 22nd, 2005, 11:37 AM
#1
Thread Starter
Member
Removing last line in header
hello
I have the following code which reads a file into the header
Dim oSec As Word.Section
Set oSec = ActiveDocument.Sections(1)
oSec.PageSetup.DifferentFirstPageHeaderFooter = True
oSec.Headers(wdHeaderFooterFirstPage).Range.InsertFile "C:\Program Files\Microsoft Office\Templates\TheHeader.doc"
but this leaves an extra line under the text inserted in the header. How do I remove that extra line in the header?
thanks
Last edited by narmi2; Jul 25th, 2005 at 03:52 AM.
-
Jul 25th, 2005, 03:53 AM
#2
Thread Starter
Member
Re: Removing last line in header
If that's not possible, how do I go to the end of the header using vba or a macro? So I can write the code to delete the last line.
Thanks
-
Jul 25th, 2005, 05:55 AM
#3
Re: Removing last line in header
Not too sure as I haven't messed around with these.
1) check the file you are inserting and make sure there is no last return line
2) record a macro that deletes (backspace) one character, and after inserting the file (if you know that the cursor is in the right place) run that macro.
3) as with (2) but tweak the macro so that it is in the header section and moves to the last part then backspaces (a little more difficult but means that the cursor on the screen doesn't have to be in the correct place).
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|