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 04:50 PM.
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 03:31 AM.
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
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.
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
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
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
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
WOW WOW
it works , what fantastic code,amazing effort.
is any way to remove dot and commas automatically through code ?
any way your effort is really appreciated
thank you so much![]()
Last edited by romperstomper; 11-08-2011 at 07:55 AM. Reason: remove quote
Sub snb() activedocument.content=replace(replace(replace(replace(replace(replace(lcase(activedocument.content),"."," "),","," "),"!"," "),"?"," "),";"," "),":"," ") For Each wd In ActiveDocument.Words If InStr(c01 & vbcr, vbcr & wd & vbcr) = 0 Then c01 = c01 & vbcr & wd Next documents.add.Content= c01 End Sub
Last edited by snb; 11-08-2011 at 11:50 AM.
I'm new to the forum, but not new to Word. How about:
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.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
Last edited by macropod; 12-22-2011 at 07:17 AM.
Cheers,
Paul Edstein
[MS MVP - Word]
Hello Paul and welcome to the forum. Your insight and expertise are always welcomed.
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks