Results 1 to 29 of 29

Thread: SmallCaps

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2001
    Location
    Sydney
    Posts
    15

    SmallCaps

    Thanks to the wonderful legal system in Australia, I need to search/replace all small caps formatted text in very long court judgments and replace it with simple uppercase text (not allcaps though).
    It should be easy, but I just can't quite see it.......any help you be greatly appreciated.

    thanks in advance.

  2. #2
    Frenzied Member Motoxpro's Avatar
    Join Date
    Sep 2001
    Location
    Spiro, OK
    Posts
    1,211
    what will they be in? like textbox listbox ect

  3. #3
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205

    Re: SmallCaps

    Originally posted by Quex
    Thanks to the wonderful legal system in Australia, I need to search/replace all small caps formatted text in very long court judgments and replace it with simple uppercase text (not allcaps though).
    It should be easy, but I just can't quite see it.......any help you be greatly appreciated.

    thanks in advance.
    Don't start. The legal system in the whole world is a ****ing joke. Us Aussies have had it easy. It's that damnable american influence.
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  4. #4

    Thread Starter
    New Member
    Join Date
    Dec 2001
    Location
    Sydney
    Posts
    15
    nothing as fancy as that, just plain old simple text being edited in word by a load of non-computery people, so a macro in word would work fine..........

  5. #5
    Frenzied Member Motoxpro's Avatar
    Join Date
    Sep 2001
    Location
    Spiro, OK
    Posts
    1,211
    soa txtbox?

  6. #6

    Thread Starter
    New Member
    Join Date
    Dec 2001
    Location
    Sydney
    Posts
    15
    yeh.

  7. #7
    Frenzied Member Motoxpro's Avatar
    Join Date
    Sep 2001
    Location
    Spiro, OK
    Posts
    1,211
    ok you could do like
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4. Dim strreplace As String
    5. If Text1.Text = "a" Then
    6. strreplace = Replace(Text1.Text, "a", "A")
    7. Text1.Text = strreplace
    8. End Sub

  8. #8
    Frenzied Member Motoxpro's Avatar
    Join Date
    Sep 2001
    Location
    Spiro, OK
    Posts
    1,211
    dont forget the end if too...so
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4. Dim strreplace As String
    5. If Text1.Text = "a" Then
    6. strreplace = Replace(Text1.Text, "a", "A")
    7. Text1.Text = strreplace
    8. End If
    9. End Sub

    is that what you mean?

  9. #9
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Originally posted by Motoxpro
    ok you could do like
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4. Dim strreplace As String
    5. If Text1.Text = "a" Then
    6. strreplace = Replace(Text1.Text, "a", "A")
    7. Text1.Text = strreplace
    8. End Sub
    I don't think you understand the nature of the problem.
    I'm trying to do a macro for this, but I haven't tried Word macros before...
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  10. #10
    DaoK
    Guest
    I need to search/replace all small caps formatted text in very long court judgments and replace it with simple uppercase text (not allcaps though).
    All cap or not all cap ?

  11. #11

    Thread Starter
    New Member
    Join Date
    Dec 2001
    Location
    Sydney
    Posts
    15
    i need to replace both small caps and all caps actually with simple uppercase, so there is no small caps or all caps in the whole document.

  12. #12
    DaoK
    Guest
    text1.text = lcase(text1.text)

    All is in low case now

  13. #13

    Thread Starter
    New Member
    Join Date
    Dec 2001
    Location
    Sydney
    Posts
    15
    its not the whole thing though....just the bits that are in scaps and acaps....

  14. #14
    DaoK
    Guest
    USe MotoxPro code for the letter a and do the same for the letter s after.

  15. #15
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    This'll do the trick. Copy this as a Macro into Word.


    Code:
    Sub ChangeMac()
        For i = 1 To Word.ActiveDocument.Characters.Count
            'Change small caps to uppercase
            If Word.ActiveDocument.Characters(i).Font.SmallCaps Then
                Word.ActiveDocument.Characters(i).Font.SmallCaps = False
                Word.ActiveDocument.Characters(i) = UCase(Word.ActiveDocument.Characters(i))
            End If
            'Change all caps to uppercase
            If Word.ActiveDocument.Characters(i).Font.AllCaps Then
                Word.ActiveDocument.Characters(i).Font.AllCaps = False
                Word.ActiveDocument.Characters(i) = UCase(Word.ActiveDocument.Characters(i))
            End If
        Next i
    End Sub
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  16. #16
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Originally posted by DaoK
    USe MotoxPro code for the letter a and do the same for the letter s after.
    Dude, you don't understand the problem. AllCaps and SmallCaps are a type of formatting in Word. AllCaps makes all characters appear as uppercase, although they aren't, and SmallCaps does the same, only the letters appear smaller.
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  17. #17
    DaoK
    Guest
    Maybe he do not want to have the "a" and "s" in capital when these letter are in the middle of the word . Example : AutrAliAn is not good but Australian is ok. So you will need to search the space before the word then replace the letter.

  18. #18

    Thread Starter
    New Member
    Join Date
    Dec 2001
    Location
    Sydney
    Posts
    15
    thanks! but try that on a 2 mb text file and takes a while......could there be a more elegant solution?

  19. #19
    Frenzied Member macai's Avatar
    Join Date
    Jul 2001
    Location
    Napanoch NY
    Posts
    1,228

    Question

    So like you mean you gotta turn the strings "HELLO I AM SO IN
    SO. hello, i am so in so" and then turn it into "Hello, I am so in so.
    Hello, i am so in so."

    Capitalization?
    Luke

  20. #20
    DaoK
    Guest
    But he wants that only for the letter "a" and "s".

  21. #21
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Originally posted by DaoK
    But he wants that only for the letter "a" and "s".

    NO HE DOESN'T !!!!
    ****ing hell....





    Quex: If you know that all the small caps will appear as whole-words, and not in the middle of words, change the word Characters everywhere I've got it to Words.

    I don't think you'll find a better solution.
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  22. #22
    DaoK
    Guest
    Originally posted by Quex
    its not the whole thing though....just the bits that are in s caps and a caps....
    Well you do not have to yell at me. I have read the quote and I have see a and s...SO please be polite.

  23. #23

    Thread Starter
    New Member
    Join Date
    Dec 2001
    Location
    Sydney
    Posts
    15
    sorry for the confusion, the whole problem arises when people are too lazy to use upper case and take things like JudGMent and hit the allcaps button to make it JUDGMENT. I need to change this to simple uppercase. The same for small caps. For everything, not just a and s.

    rjlohan's solution works great, but for huge cases that I have to edit (up to 10/11 mbs sometimes) it is not practical.


    a caps = allcaps
    s caps = smallcaps
    soz.

  24. #24
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Originally posted by Quex
    its not the whole thing though....just the bits that are in sMALL caps and aLLcaps....

    I've already explained this....
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  25. #25
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    I really don't think there's an easier way. Give it a burl on a document, and see how long it takes. It may be a couple of minutes, but it shouldn't be toooo long.
    It's just a simple bit-switch, and the UCase function.
    Admittedly, it has to do every character, but if a whole word is Allcaps'ed, then you could make my previous switch, and speed it up.

    But, like I said, that was my first Word Macro, so who knows?
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  26. #26
    DaoK
    Guest
    [QUOTEa caps = allcaps
    s caps = smallcaps [/QUOTE]

    OK so I apologize. well the Macro thing work, good job

  27. #27

    Thread Starter
    New Member
    Join Date
    Dec 2001
    Location
    Sydney
    Posts
    15
    hehe. thanx. i hope its the first of many fun-filled macro experiences for u.

  28. #28
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    I hate word, I avoid it whenever possible.
    Yesterday, I had to *fix* a doc someone made with a section break every 2-3 pages, and different even/odd, and just by removing that, I halved the document size....

    But seriously, that macro shouldn't be too bad, it only takes action on words/chars which are smallcap'ed or allcap'ed.
    It may not actually be that bad for big docs.

    Give it a burl, and let me know how it works?
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  29. #29

    Thread Starter
    New Member
    Join Date
    Dec 2001
    Location
    Sydney
    Posts
    15
    .characters takes for ever, but I changed it to searching for .words and it runs about 20sec, which is not that quick, but should be good enough.
    thnx again.

Posting Permissions

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



Click Here to Expand Forum to Full Width