+ Reply to Thread
Results 1 to 13 of 13

index for all file words

Hybrid View

  1. #1
    Registered User
    Join Date
    10-03-2009
    Location
    cairo
    MS-Off Ver
    Excel 2003
    Posts
    33

    index for all file words

    hi all
    i have book that i want to make an index for it.
    i am using the normal way which to mark the words one by one and after all i set the index at the end of last page.

    my question has two parts:
    first : is there any way to mark all the words of file without repeat and make the index for them all ?
    second: how to put the number of frequency for every word at the end of it's line ?

    hope to be cleared ,and most to find help from kind people like you

    kind regards
    sherif
    Last edited by sherif; 11-08-2011 at 05:50 PM.

  2. #2
    Registered User
    Join Date
    10-03-2009
    Location
    cairo
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: index for all file words

    ok
    but i don't want to make index for specific words , i want them all ,
    any way i made some youtube browsing and i found free program on this site :
    http://www.chrisgreaves.com/indxr.ca/
    i am working on it to find how it works
    any way ,thank you so much

  3. #3
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: index for all file words

    Hello,

    Maybe something like this is what you are after.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: index for all file words

    Extremely simple:

    Sub snb()
     For Each wd In ActiveDocument.Words
      If InStr(c01 & "|", "|" & wd & "|") = 0 Then c01 = c01 & "|" & wd
     Next
      
     with documents.add  
        .Content= Replace(c01, "|", vbCr)
     end with
    End Sub



  5. #5
    Registered User
    Join Date
    10-03-2009
    Location
    cairo
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: index for all file words

    i found pdf file through Microsoft explains how to make a concordance file
    it's attached here for interested people

    http://janetunderwood.com/Microsoft%...oncordance.pdf
    thanks

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: index for all file words

    The result should be a list of unique words.

    which duplicates do you find ? (uppercase/lowercase ?)

    Sub snb()
     For Each wd In ActiveDocument.Words
      If InStr(lcase(c01) & "|", "|" & lcase(wd) & "|") = 0 Then c01 = c01 & "|" & wd
     Next
      
     with documents.add  
      .Content= Replace(c01, "|", vbCr)
     end with
    End Sub

  7. #7
    Registered User
    Join Date
    10-03-2009
    Location
    cairo
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: index for all file words

    hi snb
    fantastic code ,it separate every word in document in line , so fast and simple
    is there any way to make the code remove the duplicated words ?
    thanks for help
    kind regards

  8. #8
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,835

    Re: index for all file words

    I'm new to the forum, but not new to Word. How about:
    Sub ConcordanceBuilder()
    Application.ScreenUpdating = False
    Dim StrIn As String, StrOut As String, StrTmp As String, i As Long, j As Long, k
    With ActiveDocument
      StrIn = .Content.Text
      For i = 1 To 255
        Select Case i
          Case 1 To 64, 91 To 96, 123 To 191, 247
          StrIn = Replace(StrIn, Chr(i), " ")
        End Select
      Next
      While InStr(StrIn, "  ") > 0
        StrIn = Replace(StrIn, "  ", " ")
      Wend
      StrIn = " " & LCase(Trim(StrIn)) & " "
      j = UBound(Split(StrIn, " "))
      For i = 1 To j
        If Len(Trim(StrIn)) = 0 Then Exit For
        StrTmp = Split(StrIn, " ")(1)
        While InStr(StrIn, " " & StrTmp & " ") > 0
          StrIn = Replace(StrIn, " " & StrTmp & " ", " ")
        Wend
        k = j - UBound(Split(StrIn, " "))
        StrOut = StrOut & StrTmp & ":" & vbTab & k & vbCr
        j = UBound(Split(StrIn, " "))
      Next
      .Range.InsertAfter Chr(12) & StrOut
    End With
    Application.ScreenUpdating = True
    End Sub
    This sub puts the word list, with frequency count, at the end of the document - starting on a new page. The 'unwanted' character exlusion set (defined by the StrIn = Replace(StrIn, Chr(i), " ") processes) is fairly comprehensive. Adding a word exclusions list (to omit certain words from the concordance), is quite simple.
    Last edited by macropod; 12-22-2011 at 08:17 AM.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  9. #9
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: index for all file words

    Hello Paul and welcome to the forum. Your insight and expertise are always welcomed.

    abousetta

  10. #10
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: index for all file words

    You can make a list of all words to be indexed in a separate Word-document.
    It's been called a 'concordance table'.
    If you use the index wizard there's an option to use this table.
    Last edited by snb; 11-08-2011 at 04:31 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1