| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 525 人关注过本帖
标题:[求助]各位寻求帮助!
只看楼主 加入收藏
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
快速回复:[求助]各位寻求帮助!
数据加载中...
 
   



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

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