473,326 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

how can i open files in my computer using command button

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
4 3518
iburyak
1,017 Expert 512MB
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
thank u very much my friend...thank u very much
Apr 5 '07 #3
iburyak
1,017 Expert 512MB
Did it work?
Apr 5 '07 #4
thank's it's work...thank u friend
Apr 5 '07 #5

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

Similar topics

9
by: rdade22 | last post by:
Hi, I'm new so try to bare with me. I'm using access 2000 and I created a database where the user is prompted to click on a command button and the info that was put on the form is sent to a table....
5
by: dgrabuloff | last post by:
i am inputting records using a form. how do i put a command button on the form that will copy the record i just input----sometimes i have the same record that needs to be put in 3 or 4 times and i...
0
by: Siebbel | last post by:
Hello, I would like to install DB2 on a remote linux computer using command line. Does anybody know if that is possible? Or if not, are there possibilities to have the graphical interface on my...
2
by: tejavenkat | last post by:
Hi, I have one scenario i.e Download as csv is there it is a command button when we click on this the save dialog box should be open,Am using javascript how can we do this by using by javascrpt...
0
by: mesadobes | last post by:
I am very new to visual basic. Actually, I have no clue what I'm doing! But I know what I want to do. I am trying to learn as I go... How do I create a command button that when clicked will...
6
vdraceil
by: vdraceil | last post by:
How to link a command button to an .exe file? To be more clear, when a command button is clicked,a .exe file must bemade to open..
2
by: darnnnel | last post by:
Hi everyone! I’m not sure how to even begin. I have a form and a subform and they are not linked. I would like to have a button on the form that would only change the data in the subform,...
4
beacon
by: beacon | last post by:
Hi everybody, I have a main form, frmDeficiency, that has a tab control, deficiencyTabControl, that has a subform, fsubEpisodeDetail, on page 2 of the tab control. I also have a command button...
1
by: marvinisla | last post by:
i am complete newbie in ms access 2007. I want to ask how to save unbound textbox value in a table using a command button? and also how to put a clock in a form. tried all the tutorial from the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.