M
magicdds
I have the following code:
Private Sub Command0_Click()
Dim strDirPath As String
Dim strOutDocName As String
Dim strDir As String
Dim strDirEntry As String
' strDirPath is a Function that Gets the path to the Microsoft Word Directory
strDirPath = DirToPath("word\", False)
strDir = strDirPath & "*.doc"
strDirEntry = Dir(strDir)
Do While strDirEntry <> ""
MsgBox strDirEntry
strDirEntry = Dir
Loop
End Sub
When I click on a button in my form , the code above runs and message boxes
pop up printing out each document in the Word directory. I would like to
populate the choices in a combo box on the form with each of these documents,
so I can click on the document thayt I want to print.
How can I populate the combo box with the list of documents instead of
displaying them with the Msgbox command?
Thanks
Mark
Private Sub Command0_Click()
Dim strDirPath As String
Dim strOutDocName As String
Dim strDir As String
Dim strDirEntry As String
' strDirPath is a Function that Gets the path to the Microsoft Word Directory
strDirPath = DirToPath("word\", False)
strDir = strDirPath & "*.doc"
strDirEntry = Dir(strDir)
Do While strDirEntry <> ""
MsgBox strDirEntry
strDirEntry = Dir
Loop
End Sub
When I click on a button in my form , the code above runs and message boxes
pop up printing out each document in the Word directory. I would like to
populate the choices in a combo box on the form with each of these documents,
so I can click on the document thayt I want to print.
How can I populate the combo box with the list of documents instead of
displaying them with the Msgbox command?
Thanks
Mark