Results 1 to 12 of 12
  1. #1
    Lounger
    Join Date
    May 2003
    Location
    Detroit, Michigan, USA
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Outline view (Word 97)

    Hi,
    For the first time, I'm trying to make serious use of outline view. I would like to get file copies of some of the different views, for example, when only level #1 headings are shown, or heading #1 and #2, etc.
    Is there a way to make file copies by level?
    Thanks, Al

  2. #2
    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: Outline view (Word 97)

    First, if I understand your question, you want to set a certain Outline level, choose Save As... and have it save only the portion of the outline that is visible at that time?

    I don't know of a way to do that. In Word 2002, you can select discontinuous swaths of text, but that would be rather time consuming (and you have have Word 2002). Would it be acceptable to capture a particular level as a PDF document (e.g., using a print-to-PDf driver)?

    I'm sure there's a way to do this with VBA, but at the moment I don't have time to write code. Hopefully you will get other suggestions.

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outline view (Word 97)

    Hi Al:
    I don't know the answer directly, but I can think of some alternatives.
    1. You can print a document in outline view while showing only certain levels & only the visible levels will print.
    2. You can create a TOC of Heading 1 or Heading 1 & 2, etc. Then you could either convert it to plain text (Ctrl+Shift+F9) & copy it into a new document
    - OR -
    use an RD field to bring the TOC into a new document. Again, that could be converted to text.
    3. You can take a picture (Alt+PrintScrn) of the outline view & paste into a new document.

    Hope one of these helps,

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

    Re: Outline view (Word 97)

    If you want to write a Macro to do this then you could use something like...

    (This code typed without any testing, may be riddled with syntax errors, just intended to show the idea)

    ActiveDocument.Content.TextRetrievalMode.ViewType = wdOutlineView
    Set docNew = Documents.Add
    docNew.Content.InsertAfter ActiveDocument.Content.Text
    Set docNew = Nothing

    This would create a new document containing the current Outline view as text only, you would lose all the original styles.

    StuartR

  5. #5
    Lounger
    Join Date
    May 2003
    Location
    Detroit, Michigan, USA
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outline view (Word 97)

    Thanks Stuart,
    Unfortunately, I'm not even remotely at the stage of competency for doing a vba macro. But after the first 40 hours, I'm sure it's as easy as falling off a log. I am saving your suggested code.
    Al

  6. #6
    Lounger
    Join Date
    May 2003
    Location
    Detroit, Michigan, USA
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outline view (Word 97)

    Phil,
    choice #2 sounds straightforward. I was hoping to preserve the heading styles, in other words, the outline look. Can you see any way to do that?
    Al

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

    Re: Outline view (Word 97)

    This seemed like an interesting idea, so I have knocked up a template with some code for you. Extract CopyOutline.DOT from the zip file and copy it to your Word Startup folder.

    You can use it with Tools > Macro > CopyOutline > OK
    It will prompt you for the level to copy and create a new document with all paragraphs at or below the specified outline level,

    regards,

    StuartR
    Attached Files Attached Files

  8. #8
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outline view (Word 97)

    I was going to suggest that you define the TOC styles in the new document to match the heading styles. But I see Stuart has come up with a better & faster method.

  9. #9
    Lounger
    Join Date
    May 2003
    Location
    Detroit, Michigan, USA
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outline view (Word 97)

    Wow Stuart, that's a real winner. I truly appreciate it.
    But is this macro really just 4 lines, including start and end, or is there some other stuff hidden somewhere, and if so, how can I look at it?
    Thank you, merci, gracias,
    Al

  10. #10
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,853
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Outline view (Word 97)

    There is a page of code hidden behind the User form (frmCopyOutline). The 4 lines of code call that user form and then the code associated with the user form take over.

    To see the code that Stuart created for the user form, show the form in the VBA Editor, select an object such as the OK button and press F7. This will reveal the code which runs when that button is clicked (along with the rest of the code for that form).
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  11. #11
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Boston, Massachusetts, USA
    Posts
    389
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outline view (Word 97)

    While working on a way to extract just the outline from a document, I did a search hoping to find a way to do it without copy/paste, and came across this thread. The following macro does pretty much the same thing as Stuart's template, but without a UserForm.

    If anyone's got a way to extract just the outline while retaining the formatting, I'd love to hear about it!

    <pre>Sub MakeOutlineOnlyFromCurrentDoc()
    Dim docFull As Document
    Dim docOutline As Document
    Dim lngMaxLevel As Integer
    Dim strUserInput As String
    Dim para As Paragraph

    lngMaxLevel = 4
    Set docFull = ActiveDocument
    Application.ScreenUpdating = False

    Do
    strUserInput = InputBox("Create an outline-only copy " & _
    "of this document to what level (1-9)?", _
    "Outline Maker", _
    lngMaxLevel)
    If Len(strUserInput) = 0 Then Exit Sub

    If Not strUserInput Like "[1-9]" Then
    MsgBox Chr(34) & strUserInput & Chr(34) & " is not a valid Outline Level.", _
    vbInformation
    End If
    Loop Until strUserInput Like "[1-9]"

    lngMaxLevel = CLng(strUserInput)

    Set docOutline = Documents.Add
    StatusBar = "Collecting outline information. Please wait ..."

    For Each para In docFull.Paragraphs
    If para.OutlineLevel <= lngMaxLevel Then
    para.Range.Copy
    docOutline.Range(docOutline.Range.End - 1).Paste
    End If
    Next para

    StatusBar = ""
    Application.ScreenUpdating = True
    End Sub
    </pre>


  12. #12
    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: Outline view (Word 97)

    How about cloning the current document (see <post#=277803>post 277803</post#>) and deleting all unwanted content? That should preserve the style definitions and formatting, but might be slow. I think there was a snippet of VBA posted recently (perhaps by you?) that would select upwards to a particular heading level. This should allow you to clear stuff in large swaths, but at this point, it's just a theory.

Posting Permissions

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