Use the LoadFile method
Supposing the filenames for the states are "C:\VIC.rtf", "C:\NSW.rtf",
"C:\SA.rtf" and "C:\Queensland.rtf" use the following:
Private Sub Combo1_Click()
RichTextBox1.LoadFile "C:\" & Combo1.Text & ".rtf"
End Sub
When the filenames are not the same as the state-names, you can use somethig
like:
Private Sub Combo1_Click()
Dim sFileName As String
sFileName = Choose(Combo1.ListIndex + 1, _
"C:\State VIC.rtf", _
"C:\Other state.rtf", _
"C:\SA.rtf", _
"C:\Ql.rtf")
RichTextBox1.LoadFile sFileName
End Sub
Hope this helps,
Johan.
I am using the Combo box dropdown list with four states in it (VIC, NSW, SA,
Queensland).
When the user selects the required state, I want a .rtf file relating to
that state to load and display
in a Richtextbox next to the Combo box.
Can someone advise me of the most commom way to achieve this with a sample
code snippett
if possible.
many thanks.....rob