Results 1 to 9 of 9
  1. #1
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Print outline view (first lines only) (2000)

    Is it possible to print outline view with the first line only (through code or otherwise?) I have a 62 pg document I need to compare to an excel document, I don't want to have to go through 62 pages if I can compress it to 7 or 8....
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Print outline view (first lines only) (2000)

    Not sure what you mean by "the first line only". If you meant "the first level only":

    Switch to Outline view.
    Use the Show Level (?) dropdown on the Outline toolbar to show only the level(s) you want to print.
    Print the document.

  3. #3
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print outline view (first lines only) (2000)

    <img src=/S/nope.gif border=0 alt=nope width=15 height=15> Sorry,
    This document wasn't designed with outline view in mind. I'm talkin about when the outline view is displaying first line only of paragraphs....
    is it possible to create a new document with the first lines of each paragraph?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Print outline view (first lines only) (2000)

    I don't know what outline view you're talking about, but the following slow and clumsy macro will copy the first line of each paragraph to a new document. You can get a cup of coffee or two while it's running.

    Sub ExtractFirstLines()
    Dim par As Paragraph
    Dim rng As Range
    Dim docSource As Document
    Dim docTarget As Document
    Application.ScreenUpdating = False
    Set docSource = ActiveDocument
    Set docTarget = Documents.Add
    For Each par In docSource.Paragraphs
    docSource.Activate
    docSource.Range(par.Range.Start, par.Range.Start).Select
    Selection.EndKey Unit:=wdLine, Extend:=wdExtend
    Selection.Copy
    docTarget.Activate
    Selection.Paste
    Selection.TypeParagraph
    Next par
    docTarget.Range.Find.Execute FindText:="^p^p", _
    ReplaceWith:="^p", Replace:=wdReplaceAll
    Application.ScreenUpdating = True
    End Sub

  5. #5
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print outline view (first lines only) (2000)

    Already done! Thanks so much Hans. I don't understand one thing though - where in the code do you tell Word where to paste?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Print outline view (first lines only) (2000)

    In both documents, the code uses the current selection (insertion point).

  7. #7
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print outline view (first lines only) (2000)

    so Set docTarget = Documents.Add
    Creates a new blank document....?
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Print outline view (first lines only) (2000)

    Yes. You said you wanted a new document, so that's what you get. You can also create a new document based on a specific template:

    Set docTarget = Documents.Add("MyTemplate.dot")

  9. #9
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print outline view (first lines only) (2000)

    Thanks for the info and the help! <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What&#39;s more, you deserve to be hacked." -Richard Clarke

Posting Permissions

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