小弟我是初学者,小弟我想问个很菜的有关问题,希望高手们帮小弟我一下!多谢了

我是菜鸟,我想问个很菜的问题,希望高手们帮我一下!!谢谢了
我在VB窗体里有个文本框input和一个打开按钮,还有个CommonDialog控件,还有个打印按钮,我希望我点打开可以在input里显示我要打印的word路径,然后点打印就可以打印该路径中word里的内容.那位大哥告诉我代码怎么写啊???谢谢了!!

------解决方案--------------------
Private Sub cmdOpen_Click()
On Error GoTo errhandler
CommonDialog1.CancelError = True
' Set flags
CommonDialog1.Flags = cdlOFNHideReadOnly + cdlOFNPathMustExist + cdlOFNFileMustExist
' Set filters
CommonDialog1.Filter = "All Files (*.*)|*.*|RTF (*.rtf)|*.rtf|Text Files (*.txt)|*.txt "

' Display the Save dialog box
CommonDialog1.Filename = " "
CommonDialog1.ShowOpen
input.Text = "File Selected: " & CommonDialog1.Filename
Exit Sub
errhandler:
Select Case Err
Case 32755 ' Dialog Cancelled
MsgBox "you cancelled the dialog box "
Case Else
MsgBox "Unexpected error. Err " & Err & " : " & Error
End Select
End Sub


这样就显示了你要的路径
------解决方案--------------------
打印的代码就再添加关于word的引用吧
Private Sub Form_Load()
Dim wordApp As New Word.Application
Dim newDoc As New Word.Document
Set newDoc = Documents.Open( "c:\1.doc ")
newDoc.PrintOut
newDoc.Close
wordApp.Quit
Set wordApp = Nothing
Set newDoc = Nothing
End Sub
这段代码就是打印word文档的
你把 "c:\1.doc "换成filename就可以了