|
-
Dec 10th, 2001, 06:10 PM
#1
Thread Starter
New Member
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.
-
Dec 10th, 2001, 06:20 PM
#2
Frenzied Member
what will they be in? like textbox listbox ect
-
Dec 10th, 2001, 06:21 PM
#3
PowerPoster
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]
-----------------------------------------
-
Dec 10th, 2001, 06:23 PM
#4
Thread Starter
New Member
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..........
-
Dec 10th, 2001, 06:34 PM
#5
Frenzied Member
-
Dec 10th, 2001, 06:35 PM
#6
Thread Starter
New Member
-
Dec 10th, 2001, 06:40 PM
#7
Frenzied Member
ok you could do like
VB Code:
Option Explicit
Private Sub Form_Load()
Dim strreplace As String
If Text1.Text = "a" Then
strreplace = Replace(Text1.Text, "a", "A")
Text1.Text = strreplace
End Sub
-
Dec 10th, 2001, 06:42 PM
#8
Frenzied Member
dont forget the end if too...so
VB Code:
Option Explicit
Private Sub Form_Load()
Dim strreplace As String
If Text1.Text = "a" Then
strreplace = Replace(Text1.Text, "a", "A")
Text1.Text = strreplace
End If
End Sub
is that what you mean?
-
Dec 10th, 2001, 06:43 PM
#9
PowerPoster
Originally posted by Motoxpro
ok you could do like
VB Code:
Option Explicit
Private Sub Form_Load()
Dim strreplace As String
If Text1.Text = "a" Then
strreplace = Replace(Text1.Text, "a", "A")
Text1.Text = strreplace
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]
-----------------------------------------
-
Dec 10th, 2001, 06:43 PM
#10
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 ?
-
Dec 10th, 2001, 06:47 PM
#11
Thread Starter
New Member
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.
-
Dec 10th, 2001, 06:47 PM
#12
text1.text = lcase(text1.text)
All is in low case now
-
Dec 10th, 2001, 06:50 PM
#13
Thread Starter
New Member
its not the whole thing though....just the bits that are in scaps and acaps....
-
Dec 10th, 2001, 06:52 PM
#14
USe MotoxPro code for the letter a and do the same for the letter s after.
-
Dec 10th, 2001, 06:53 PM
#15
PowerPoster
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]
-----------------------------------------
-
Dec 10th, 2001, 06:54 PM
#16
PowerPoster
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]
-----------------------------------------
-
Dec 10th, 2001, 06:55 PM
#17
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.
-
Dec 10th, 2001, 06:55 PM
#18
Thread Starter
New Member
thanks! but try that on a 2 mb text file and takes a while......could there be a more elegant solution?
-
Dec 10th, 2001, 06:55 PM
#19
Frenzied Member
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?
-
Dec 10th, 2001, 06:57 PM
#20
But he wants that only for the letter "a" and "s".
-
Dec 10th, 2001, 07:00 PM
#21
PowerPoster
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]
-----------------------------------------
-
Dec 10th, 2001, 07:02 PM
#22
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.
-
Dec 10th, 2001, 07:03 PM
#23
Thread Starter
New Member
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.
-
Dec 10th, 2001, 07:03 PM
#24
PowerPoster
Originally posted by Quex
its not the whole thing though....just the bits that are in s MALL caps and a LLcaps....
I've already explained this....
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Dec 10th, 2001, 07:06 PM
#25
PowerPoster
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]
-----------------------------------------
-
Dec 10th, 2001, 07:11 PM
#26
[QUOTEa caps = allcaps
s caps = smallcaps [/QUOTE]
OK so I apologize. well the Macro thing work, good job
-
Dec 10th, 2001, 07:12 PM
#27
Thread Starter
New Member
hehe. thanx. i hope its the first of many fun-filled macro experiences for u.
-
Dec 10th, 2001, 07:15 PM
#28
PowerPoster
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]
-----------------------------------------
-
Dec 10th, 2001, 07:21 PM
#29
Thread Starter
New Member
.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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|