473,387 Members | 1,493 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,387 software developers and data experts.

Reading text without an Open File dialog - visual basic

Hello, everyone!

I am trying to create an application like Notepad in Visual Basic 2005.
But how can I make this application read all text from a text file without having to display an Open File dialog?

An example:

A user has created a text file and saved it to the desktop, the document folder or whatever. The day after this user wants to edit the file, but when he opens the file, no text appears.
How do I fix this?
May 29 '07 #1
4 2317
SammyB
807 Expert 512MB
Hello, everyone!

I am trying to create an application like Notepad in Visual Basic 2005.
But how can I make this application read all text from a text file without having to display an Open File dialog?

An example:

A user has created a text file and saved it to the desktop, the document folder or whatever. The day after this user wants to edit the file, but when he opens the file, no text appears.
How do I fix this?
In VB.Net you use StreamWriter and/or StreamReader. It's explained at http://support.microsoft.com/kb/304427
May 29 '07 #2
I'm sorry, but it didn't help :(

My problem is:

when a user double clicks a text file, in the document folder, on the desktop, in the hard drive folder or whatever, Notepad opens and automatically reads the text that is stored in this file. What I miss in my application is a code that does what I described.

Do you have a code which may fix this?
May 31 '07 #3
SammyB
807 Expert 512MB
I'm sorry, but it didn't help :(

Do you have a code which may fix this?
No, you do! :o)

For each filetype that you want to open with your program, right-click, Open With, Choose Program, Browse to your program, and set the checkbox, always use the selected program. This can be done automatically with your install script: I'll post a link later when I find it.
May 31 '07 #4

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

Similar topics

1
by: Mark | last post by:
Hello all! I've created an ASP.NET project using Visual Studio 2003 and C#. The project is quite basic in that it simply needs to read in the contents of a text file (.txt). I have the...
3
by: Bre-x | last post by:
Hi, I have a text file that is made of a number of paragraphs: each paragraph start with either: ":O", ":N", or ":" follow by a 4 digit number and finish with either: M30 or M99 What I need...
3
by: tigrrgrr42 | last post by:
I am working(vb.net03and05) with word documents stored in a sql db and I am currently bringing them from a byte array into a temp file to pop into word and make word do its thing as a com object. ...
7
by: Michael Galvin | last post by:
I am trying to use Python to send to the printer a calender filled with a mix of text and simple graphics. I want to draw on the printed page something like a table with 6 rows and 7 columns to...
5
by: Anja | last post by:
Hi everyone, I have a question about text file reading with VBA. I want to read he whole contents of the file in one string variable. I have been able to successfully read lines using: Line...
1
by: jongjong | last post by:
elow...i am a new in visual basic programming can you help me in opening a text files that contain a certain langauage and translate it to another langauge when it is open in visual basic in the...
7
by: ianenis.tiryaki | last post by:
well i got this assignment which i dont even have a clue what i am supposed to do. it is about reading me data from the file and load them into a parallel array here is the question: Step (1) ...
5
by: rn5a | last post by:
Can someone please suggest me a text editor especially for DEBUGGING ASP scripts apart from Microsoft Visual Interdev? I tried using Visual Interdev & created a project but Interdev generates...
23
by: =?Utf-8?B?TWlrZTE5NDI=?= | last post by:
This is an example that is supposed to work in VB http://support.microsoft.com/kb/175512/en-us After spending a couple of hours downloading and installing VB Express 2008 after someone told me it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.