Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

storm69 (TechnicalUser) (OP)
1 Feb 06 11:27
I am using a home automation application that uses VB Scripts. One of the functions is Caller ID which announces the caller through MS Agent.  The problem is that the phone company returns all Upper case letters in the idenity in which MS Agent spells out the name vs saying it.  Is there a way to take the caller ID string and convert all the upper case letters after the first to lower case. I've been searching but not able to find anything in regards to this request. I am very new VB Scripting but trying to learn so any and all help is greatly appreciated.
Helpful Member!(2)  mrmovie (TechnicalUser)
1 Feb 06 11:30
strX = "MRMOVIE"
str1st = Left(strX, 1)
strRest = Right(strX, Len(strX) - 1)
strOutput = UCase(str1st) & LCase(strRest)
mrmovie (TechnicalUser)
1 Feb 06 11:31
strX = "MRMOVIE"
strOutput = UCase(Left(strX, 1)) & LCase(Right(strX, Len(strX) - 1))
PHV (MIS)
1 Feb 06 11:59
newVar = StrConv(oldVar, 3) ' 3=vbProperCase

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886

storm69 (TechnicalUser) (OP)
1 Feb 06 12:02
Okay, that makes sense but when I tried this it didn't work. I think that the reason is due to the fact that the string I want to change is in the middle. Using your example here is what I did but it ignored the MIDDLE string. I am also making the assumtion that my output string will now be "A"
        y=left(ID,10)
        w=right(ID,8)
        MyString = (ID)
        FirstWord = Mid(MyString, 1, 10)
        LastWord = Mid(MyString, 25, 8)
        MidWord = Mid(MyString, 11, 15)
        strA = Midword
        str1st = Left(strA, 1)
        strRest = Right(strA, Len(strA) - 1)
        strOutput = UCase(str1st) & LCase(strRest)

        Character.Speak "Call from " & A & y
mrmovie (TechnicalUser)
1 Feb 06 12:07
now why doesnt my vbscript and wsh documentation show me the StrConv function!! time to visit M$ download site, thank PHV
mrmovie (TechnicalUser)
1 Feb 06 12:12
'how about something like this

strX = "mRMOVIE"
For i = 1 To Len(strX)
   strTemp = Mid(strX, i, 1)
   If UCase(strTemp) = strTemp Then 'we have uppercase
      Exit For
   End If
Next

strResult = Left(strX, i) & LCase(Right(strX, Len(strX) - i))
Msgbox strResult
storm69 (TechnicalUser) (OP)
1 Feb 06 12:39
I tried this using the above example with the following code and it still didn't work. I got the following error message:  Script Error: Line 231 Wrong number of arguments or invalid property assignment: 'right'.  Here is the code the way I changed it. Again, I'm not sure about the Middle word "Midword" and if I'm using it correctly as "strA".


sub Devices_CIDUpdate(ID)
        y=left(ID,10)
        w=right(ID,8)
        MyString = (ID)
        FirstWord = Mid(MyString, 1, 10)
        LastWord = Mid(MyString, 25, 8)
        MidWord = Mid(MyString, 11, 15)
        strA = Midword
        For i = 1 To Len(strA)
          strTemp = Mid(strA, i, 1)
          If UCase(strTemp) = strTemp Then 'we have upper case
             Exit For
          End If
        Next
        strResult = Left(strA, i) & LCase(Right(strA) - i)
storm69 (TechnicalUser) (OP)
1 Feb 06 12:56
Ooops, stupid me!!! Caught my own mistake in the strResult line. Helps if you put all of the code in there.  It works like a charm, thank you so very much.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close