By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,508 Members | 1,856 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,508 IT Pros & Developers. It's quick & easy.

how can i open files in my computer using command button

P: 21
hi,
Is any one can help me to open files in my computer(for an example: some word document)using command button... i want to open file's using my vb programme..but i can't do it...can any one help me? for an example there is a "open" button in every programme...i want cord for "open" bitton
thanks..
Apr 5 '07 #1
Share this Question
Share on Google+
4 Replies


iburyak
Expert 100+
P: 1,017
Go to projecct - components
Check

[PHP]Microsoft Common Dialog Control, Version 6.0[/PHP]

Modify code below as you wish.

[PHP]Dim sFileName As String, NextLine As String

Dim FH As Long



With CommonDialog1

.CancelError = True

.Filter = "All Files(*.*)|*.*|Text Files(*.txt)|*.txt"

.FilterIndex = 2

.InitDir = "I use this property when I have default directory standard or in many cases I save last used path"

.ShowOpen



sFileName = .FileName

End With



FH = FreeFile()



Open sFileName For Input Access Read Shared As #FH



Do Until EOF(FH)

Line Input #FH, NextLine

Text1.Text = Text1.Text & vbCrLf

Loop



Close #FH [/PHP]

Good Luck.
Apr 5 '07 #2

P: 21
thank u very much my friend...thank u very much
Apr 5 '07 #3

iburyak
Expert 100+
P: 1,017
Did it work?
Apr 5 '07 #4

P: 21
thank's it's work...thank u friend
Apr 5 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.