batosai17
05-08-2007, 12:39 AM
guyz, please help me..hoho.. vba word..
this is my coding:
Private Sub myCleverRemarks_Click()
Dim detail
Dim companyName
Dim companyNameRange As Range
Select Case myCleverRemarks.Value
Case "Orthopadie & Unfallchirurgie"
companyName = "Orthopadie & Unfallchirurgie :"
detail = _
companyName + vbCrLf + vbCrLf + _
" Chefarzt: Dr. Med. Th. Schockenhoff " + vbCrLf + _
" Sekretariat: Frau Hoffmeier " + vbCrLf + _
" Telefon 0 000000" + vbCrLf + _
" Telefax 0 11111111"
Case "Fachbereich Innere Medizin"
companyName = "Fachbereich Innere Medizin :"
detail = _
companyName + vbCrLf + vbCrLf + _
" Chefarzt: Prof. Dr. med. H. R. Ochs " + vbCrLf + _
" Sekretariat: Frau Titze/ Frau Passarge/ Frau Meise " + vbCrLf + _
" Telefon 0 1111111 " + vbCrLf + _
" Telefax 0 111111111 " + vbCrLf + _
" eMail test (innere@mkh-soest.de) "
Case "Kardiologie, Angiologie, Diabetologie :"
companyName = "Kardiologie, Angiologie, Diabetologie"
detail = _
companyName + vbCrLf + vbCrLf + _
" Chefarzt: Prof. Dr. med. H. R. Ochs " + vbCrLf + _
" Telefon 0111111111" + vbCrLf + _
" Telefax 0 11111111111 "
Case Else
test = _
"Unknown"
End Select
selection.Text = detail
Set companyNameRange = selection.Range
companyNameRange.Find.Execute FindText:=companyName, Forward:=True
If companyNameRange.Find.Found = True Then
companyNameRange.Bold =True
companyNameRange.Font.Size = 10
companyNameRange.Font.Name = "Arial"
End If
frmRemarks.Hide
End Sub
but how to make the companyName = "Orthopadie & Unfallchirurgie :"
is bold and the other :
" Chefarzt: Dr. Med. Th. Schockenhoff " + vbCrLf + _
" Sekretariat: Frau Hoffmeier " + vbCrLf + _
" Telefon 0 1111111111111" + vbCrLf + _
" Telefax 0 11111111111111 "
is not bold..
so, this is the value of combobox.. so, if i choose the one of the company name, it will be show in word like this:
( example i choose the second )
so the final like this :
Fachbereich Innere Medizin :
Chefarzt: Prof. Dr. med. H. R. Ochs
Sekretariat: Frau Titze/ Frau Passarge/ Frau Meise
Telefon 011111111
Telefax 0 111111111
eMail jsjasa (innere@mkh-soest.de)
but this is all bold, i just want like this :
Fachbereich Innere Medizin :
Chefarzt: Prof. Dr. med. H. R. Ochs
Sekretariat: Frau Titze/ Frau Passarge/ Frau Meise
Telefon 0 111111111111111
Telefax 011111111111
eMail ddasafsdsa (innere@mkh-soest.de)
i already search in internet, but i can't solve this problem.. anyone know the solution? please help me.. thanx..
Edited 9-May-07 by geekgirlau. Reason: Change to descriptive title
this is my coding:
Private Sub myCleverRemarks_Click()
Dim detail
Dim companyName
Dim companyNameRange As Range
Select Case myCleverRemarks.Value
Case "Orthopadie & Unfallchirurgie"
companyName = "Orthopadie & Unfallchirurgie :"
detail = _
companyName + vbCrLf + vbCrLf + _
" Chefarzt: Dr. Med. Th. Schockenhoff " + vbCrLf + _
" Sekretariat: Frau Hoffmeier " + vbCrLf + _
" Telefon 0 000000" + vbCrLf + _
" Telefax 0 11111111"
Case "Fachbereich Innere Medizin"
companyName = "Fachbereich Innere Medizin :"
detail = _
companyName + vbCrLf + vbCrLf + _
" Chefarzt: Prof. Dr. med. H. R. Ochs " + vbCrLf + _
" Sekretariat: Frau Titze/ Frau Passarge/ Frau Meise " + vbCrLf + _
" Telefon 0 1111111 " + vbCrLf + _
" Telefax 0 111111111 " + vbCrLf + _
" eMail test (innere@mkh-soest.de) "
Case "Kardiologie, Angiologie, Diabetologie :"
companyName = "Kardiologie, Angiologie, Diabetologie"
detail = _
companyName + vbCrLf + vbCrLf + _
" Chefarzt: Prof. Dr. med. H. R. Ochs " + vbCrLf + _
" Telefon 0111111111" + vbCrLf + _
" Telefax 0 11111111111 "
Case Else
test = _
"Unknown"
End Select
selection.Text = detail
Set companyNameRange = selection.Range
companyNameRange.Find.Execute FindText:=companyName, Forward:=True
If companyNameRange.Find.Found = True Then
companyNameRange.Bold =True
companyNameRange.Font.Size = 10
companyNameRange.Font.Name = "Arial"
End If
frmRemarks.Hide
End Sub
but how to make the companyName = "Orthopadie & Unfallchirurgie :"
is bold and the other :
" Chefarzt: Dr. Med. Th. Schockenhoff " + vbCrLf + _
" Sekretariat: Frau Hoffmeier " + vbCrLf + _
" Telefon 0 1111111111111" + vbCrLf + _
" Telefax 0 11111111111111 "
is not bold..
so, this is the value of combobox.. so, if i choose the one of the company name, it will be show in word like this:
( example i choose the second )
so the final like this :
Fachbereich Innere Medizin :
Chefarzt: Prof. Dr. med. H. R. Ochs
Sekretariat: Frau Titze/ Frau Passarge/ Frau Meise
Telefon 011111111
Telefax 0 111111111
eMail jsjasa (innere@mkh-soest.de)
but this is all bold, i just want like this :
Fachbereich Innere Medizin :
Chefarzt: Prof. Dr. med. H. R. Ochs
Sekretariat: Frau Titze/ Frau Passarge/ Frau Meise
Telefon 0 111111111111111
Telefax 011111111111
eMail ddasafsdsa (innere@mkh-soest.de)
i already search in internet, but i can't solve this problem.. anyone know the solution? please help me.. thanx..
Edited 9-May-07 by geekgirlau. Reason: Change to descriptive title