Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change a folder name to allcaps 1

Status
Not open for further replies.

pendle666

Technical User
Jan 30, 2003
295
GB
Hello

My code creates a folder with the name of an individual, say Smith John and then saves the document with the name John Smith letter.doc.

I need to have the Smith bit in the folder allcaps so it looks like SMITH John - can this be done. This is the code so far which does work.

regards
Pendle



strRoot = (where the folders are)
strSubFolder = strSurname & " " & strName
strFolder = strRoot & "\" & strSubFolder
strFileName = strName & " " & strSurname & " Offer Letter.doc"
strFullPath = strFolder & "\Contractual\" & strFileName

intResponse = MsgBox("Saving file as " & strFullPath & vbCrLf & vbCrLf & "Okay?", vbYesNo)
If intResponse = vbYes Then
If Dir(strFolder, vbDirectory) = "" Then
intResponse = MsgBox("Folder " & strFolder & " does not exist." & vbCrLf & "Create?", vbYesNo)
If intResponse = vbYes Then
MkDir strFolder
MkDir strFolder & "\Training"
MkDir strFolder & "\Benefits"
MkDir strFolder & "\Miscellaneous"
strFolder = strFolder & "\Contractual"
Else
strFolder = strRoot
strFullPath = ""
End If
End If
Else
 
You can't change the casing of a folder directly (you have to rename it to something else and then back to the re-cased original), but if you're creating the folder, instead of using [tt]strSurname[/tt], use [blue][tt]Ucase(strSurname)[/tt][/blue]

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top