Results 1 to 2 of 2

Thread: [RESOLVED] Footer values in Word & XL- empty, says its full

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    USA, East Coast
    Posts
    257

    Resolved [RESOLVED] Footer values in Word & XL- empty, says its full

    Hello,

    I need to determine if my footers are empty or not. They keep coming up as filled, although I know they're not.

    I've tried these 3 different lines of code.
    Code:
    If IsEmpty(oWordDoc.Sections(1).Footers(1).Range.Text) Then   etc..
    Code:
    If IsNull(oWordDoc.Sections(1).Footers(1).Range.Text) Then   etc..
    Code:
    If oWordDoc.Sections(1).Footers(1).Range.Text="" Then   etc..
    In debug, I can tell that there's some stray control character that makes the program think there a true value there.
    Do I need to do regular expressions that will only look for A-Z, 0-9 ? Or is there another function call?

    I also need to do the same for XL. I Write to the footer like this:

    Code:
    With xlWB.ActiveSheet.PageSetup
            .LeftFooter = ""
            .CenterFooter = footerMsg
    End With
    Thanks,
    CyberJar

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Footer values in Word & XL- empty, says its full

    the character in the word footer is a paragraph mark, chr(13)
    vb Code:
    1. if len(oWordDoc.Sections(1).Footers(1).Range.Text) > 1 then ' something extra in the footer
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width