Good day all,
I have a problem of which I hop you can help me out with.
I have a userform to put in personal data of a client. The data my collegues
put in will be ending up in al letter. Now, in one ocasion Someone's name is
for example Guus van Waardenburg. When you write the name with the first name
'van' needs to be written in lower case, when you only write the last name,
'van' needs to be starting with a capital like this: 'Van Waardenburg', how
can I put this in my code?
My Code:
Selection.GoTo What:=wdGoToBookmark, Name:="Aanhef"
If TextBox4.Value = "" Then
If Not TextBox3.Value = "" Then
Selection.TypeText TextBox10 & " " & TextBox3 & " " & TextBox1 &
","
Else
Selection.TypeText TextBox10 & " " & TextBox1 & ","
End If
ElseIf Not TextBox17.Value = "" Then
Selection.TypeText TextBox10 & " " & TextBox17 & " " & TextBox4 & ","
Else
Selection.TypeText TextBox10 & " " & TextBox4 & ","
End If
Can someone help? (TextBox17 = van)
Dave Lett - 31 May 2006 14:14 GMT
Hi,
I'm not sure what your conditions are in context of your overall routine, so
maybe this little snippet will get you going in the right direction (then
set bCondition to False and run it again):
Dim sName As String
Dim bCondition As Boolean
sName = "van"
bCondition = True
If bCondition Then
sName = StrConv(sName, vbProperCase)
Else
sName = sName
End If
MsgBox sName
HTH,
Dave
> Good day all,
>
[quoted text clipped - 31 lines]
>
> Can someone help? (TextBox17 = van)