标题:[求助]各位寻求帮助!
只看楼主
scw501502
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-7-6
 问题点数:0 回复次数:0 
[求助]各位寻求帮助!

各位大虾,偶是初学者,我在编程时想利用openfiledialog打开Word文档,但不知如何实现?请指点,以下是偶的编程:
Private Sub btnopen_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnopen.Click
With OpenFileDialog1 'set the open dialog properties
.Filter = "text files(*.txt)|*.txt|all files(*.*)|*.*"
.FilterIndex = 1
.InitialDirectory = "c:\documents and settings\phenixbb\桌面"
.Title = "demo open file dialog"
End With
'show the open dialog and if the user clicks the OK button,load the file
If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
strfilename = OpenFileDialog1.FileName
Dim objreader As StreamReader = New StreamReader(strfilename)
txtfile.Text = objreader.ReadToEnd()
objreader.Close()
objreader = Nothing
rtbfile.LoadFile(strfilename, RichTextBoxStreamType.PlainText)
End If
End Sub

谢谢!
搜索更多相关主题的帖子: documents settings Object files 
2006-07-06 10:59



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-76847-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.021809 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved