Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Park City, Utah
    Posts
    189
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Signature Lines (Word 2000 VBA)

    I need an effective routine to keep the last sentence of a paragraph with the rest of the signature block. For example:

    PARAGRAPH HEADING: This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text. This is a paragraph of text.



    _________________________
    DICTATOR NAME

    AHS159
    D: MM/DD/YYYY
    T: MM/DD/YYYY
    JOB#: 12345

    The object to avoid orphans on the last page. I can use Keep Together for all of the lines in the signature block, but how do I just get the last sentence or the last 2 lines without making a new paragraph? This is one feature that WP had that I miss, block protect, it was simple with that feature. I could not find anything in Word that emulates it.

    Thanks!

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Signature Lines (Word 2000 VBA)

    Are you saying that the Format-->Paragraph-->Line and Page Breaks-->Widow/Orphan control doesn't work for you? Or the Keep Lines Together and/or Keep With Next?
    Charlotte

  3. #3
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Park City, Utah
    Posts
    189
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Signature Lines (Word 2000 VBA)

    The problem is when the page breaks somewhere in that signature block. Then officially, there are no widows/orphans. The Keep Together works to keep all of the signature block together, but then the last paragraph is on the prior page. If I use keep with next, the entire paragraph goes down onto the next page which is also not acceptable.

    I'm trying to set it so just the last sentence or last 2 lines of text come down with the signature block. I don't know if I can solve this the way Word treats formatting.

    Thanks!

  4. #4
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Signature Lines (Word 2000 VBA)

    I'm probably missing something terribly obvious here, but isn't it possible to include the last one or two paragraphs of your "body text" in the block that you're trying to keep together?

    Alan

  5. #5
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Park City, Utah
    Posts
    189
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Signature Lines (Word 2000 VBA)

    If a the whole paragraph moves to the next page, then there is a huge blank space at the bottom of the prior page.

  6. #6
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Signature Lines (Word 2000 VBA)

    Sorry, looking at the sample text in your original post, I assumed it was all short paragraphs. From what you say, you'd like to break the last couple of sentences off the last paragraph in cases where the sig block becomes isolated on its own page. These would then become the new last paragraph, which would be kept together (on the last page) with the sig block. Is this correct?

    I find it an intriguing problem, but being pretty green on the Word object model/ VBA, I can't offer an obvious solution. I'll ponder on it though. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    Alan

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Signature Lines (Word 2000 VBA)

    You can play with inserting a conditional IF field in the word document to turn on a page break when certain conditions are met and a zero length string when they are not. That would put the lines you want kept together on another page. You would probably need to use a line count to figure out *when* to turn it on.
    Charlotte

  8. #8
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Signature Lines (Word 2000 VBA)

    I tried doing something based on two bookmarks called BlockStart and BlockEnd and cross references to the page numbers.

    The trouble is that a conditional field that says { IF { PAGEREF BlockStart }={PAGEREF BlockEnd } "" "newpage" }
    (where newpage was a page break) doesn't quite do it. If the two bookmarks are on different pages then the condition is false and it should insert a page break, but now the condition is true so it removes it next time I update fields.

    Oh dear, back to the drawing board.

    StuartR

Posting Permissions

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