Comparing Textbox To Notepad File
Hi,
How can i get a textbox to compare what is written in it to a list in a notepad file for a login form?
Thanks for any help
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Copy All Text From Textbox, Open Notepad, And Automatically Paste To New Notepad Shee
Hello everyone.
I am trying to copy all text, that is already in the textbox, to a new notepad sheet.
Example:
Step 1. Copy all text in Text1 box to clipboard.
Step 2. Open Notepad
Step 3. Paste clipboard to notepad.
All this should be done with one click of a button.
I get as far as copying everything to the clipboard, and it even opens up notepad, but I still have to manually paste (CTRL-V) into notepad.
I would even like it to ask me what name to save it as as well as where to save it at...just like the Save As function in Word or something.
Here is what I have so far.
Private Sub cmdCopytoClipboard_Click()
Dim MyAppID
Clipboard.Clear
Clipboard.SetText Text1.Text
MyAppID = Shell("NOTEPAD.EXE", 1)
AppActivate MyAppID
MyAppID = Clipboard.GetText()
End Sub
Textbox To Work As Simple Notepad
I have a form with a multine textbox and a vertical scroll bar. I open a small .txt file and populate this textbox. This list will always be very small, but I wanted this textbox to work like a simple version of notepad, where the user can edit the list. This works fairly well except for one thing:
The Enter key does not work in the multiline textbox. As a matter of fact, since I also have a Save button (set as default) on this form, if the user presses the Enter key, it will save the list and close the edit form. Shift Enter works, but this does not seem natural to the user. I can remove the default property from the Save button, but this still doesn't solve my problem of no Enter key functionality. I would like the Enter key to work as inserting a vbCrLf wherever the cursor is at.
Does anyone know how to make a multiline textbox work as a simple Notepad?
Also, I load the list using Line Input but when I save, I have to use the following. Depending on what I do while editing. this occasionally results in a blank item at the end of my list that can cause an error the next time I load. Is this the correct way, or is there an easier way?
Code:
Private Sub btnSave_Click()
Open App.Path & "groups.txt" For Output As #1
savString = txtGrpList.Text
mySplit = Split(savString, vbCrLf)
For t = 0 To UBound(mySplit) - 1
Print #1, mySplit(t)
Next t
Close #1
Unload Me
End Sub
Thank you,
Joe
Large Text In Textbox Can Be Edited By Notepad
Hi there,
I was wondering how I could prevent the next thing:
I have made a program wich has a help file integrated in the exe itself. you can call it by pressing a button and a form will appear with the help file in a textbox. When I opened the exe file with notepad and I was just searching for things that I could understand I saw the whole text like it would appear in the textbox. I think this is rather unproffesional. I have inserted the text in the textbox true the text propertie of the textbox. So how can I prevent that the text will be completely readable by notepad?
Thanks for the help in advance,
Devoney
Help With TextBox Adding And Comparing.
I am tring to make a program to calculate the Total for a round of Golf and compare each Golfer's score on each hole for a league scoring system.
Each hole is worth 1 Point and a tie gives each Golfer a 1/2 Point. I am having trouble with correcting a scoring typo. After I put in the scores, cannot make a change unless I close out the program and start over. here is my code:
Private Sub cmdCalculate_Click()
Dim i As Long, i1stTotal As Long, i2ndTotal As Long, _
Score1 As Long, Score2 As Long
For i = 0 To 8
i1stTotal = i1stTotal + Val(txtHole1stPerson(i))
i2ndTotal = i2ndTotal + Val(txtHole2ndPerson(i))
Score1 = Val(txtHole1stPerson(i))
Score2 = Val(txtHole2ndPerson(i))
If Score1 > 0 And Score2 > 0 Then
If Score1 < Score2 Then ' 1st person wins hole
txtPointsa = Val(txtPointsa) + 1
ElseIf Score2 < Score1 Then ' 2nd person wins hole
txtPointsb = Val(txtPointsb) + 1
ElseIf Score1 = Score2 Then ' Tie hole
txtPointsa = Val(txtPointsa) + 0.5
txtPointsb = Val(txtPointsb) + 0.5
End If
End If
Next
txt1stTotal = i1stTotal
txt2ndTotal = i2ndTotal
End Sub
Comparing Listbox To Textbox
hi guys!
problem
i don't have a clue what to put next near the end of the code!
i think i have the bits before sussed its just the ending part.
I require it to search through the list box and compare whats in the txtFilmsearch.Text and just reply a msgbox saying "you dont have that film".
VB Code:
Private Sub cmdFilmsearch_Click() If txtFilmsearch.Text = "" Then MsgBox "Nothing has been entered for us to search for!", vbExclamation Else If txtFilmsearch.Text = lstFilm.Text Then MsgBox "You already have that film :)", vbInformation Else if txtFilmsearch.Text End Sub
All help appreciated ty
Comparing Words In A Textbox...
hi all..
I have a textbox with some lines of text in it.
How could I be able to pass each word in the textbox through so that I could use it in a function I have.
to give you an idea what I mean.. I have a function which compares a word the user enters with each word in the textbox i have.
so theres two textboxes. One with a bunch of lines of text in it. and one where user entered a word. System should be able to take users word and compare it with each word in the textbox (by passing it in the function I have).
my question is how do I collect each word so that I could compare them?
any ideas?
many thanks
Abe
Help Comparing A Textbox Input
I am trying to make a simple program wich ask your name, and if the name entered is "edna" it should display a msgbox with a statement. If not it should display a different statement. IThe problem is that i do not know how to tell VB to search for the character. If I use it with numbers the program runs ok, but with letters it just do the "else" option. The code I am using (with numbers) is bellow.
Private Sub Command1_Click()
If Text1 = 1 Then ' verifica si el nombre es 1
MsgBox "Hola Mi Grillitico" 'visualiza mensaje para 1
Else ' si no es edna
MsgBox "hola " + Text1
End If
End Sub
How Can I Export The Data I Entered In My Textbox To Textfile(notepad)
Hello!
How can I export entered data in my textbox to textfile(notepad).
Here's my program that exports entered data in my textbox to Excel.
However if I changed the line oBook.Saveas "C:Book1.xls" to
oBook.Saveas "C:Book1.txt, I cannot get the Desired output in Notepad line by line:
PatientName
Dictation
AccountNumber
Is there another possible way to automatically export data to textfile?
Private Sub SaveAsText_Click()
Dim oExcel As Object
Dim oText As Object
Dim oBook As Object
Dim oSheet As Object
'Start a new workbook in Excel
Set oExcel = CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks.Add
'Add data to cells of the first worksheet in the new workbook
Set oSheet = oBook.Worksheets(1)
oSheet.Range("A1").Value = txtPatientName.Text
oSheet.Range("A2").Value = txtDictationJobNumber
oSheet.Range("A3").Value = txtAccountNumber
'Save the Workbook and Quit Excel
oBook.Saveas "C:Book1.xls"
oExcel.Quit
End Sub
Putting Text From Notepad To A Textbox. Pleeese Helpp!
hello,
i probably asked this question before, but i wasn't here to see the answer. i want to transfer text from a notepad file into a textbox when the form that the textbox is in loads. i have this code:
Dim iFileNum As Integer
iFileNum = FreeFile
Open App.Path & "folder ext.ini" For Append As iFileNum
Print #iFileNum, mainform.textbox.Text
mainform.textbox.Text = iFileNum
Close iFileNum
can someone please correct my code so thst it will do what i want it to do? (above)
thanks in advance.
Comparing Results And Displaying Recordset In Textbox
Hey guys, I need some suggestion as to how about doing my project. Basically it's using ADO, VB6 and Access.
Things is that after scanning the bar code value into VB, I need to compare the results with the ones in the Access database and display them into text boxes. Below is the attached program I've written so far. The barcode will be scanned into the card_val and I was thinking that by comparing the value in card_val with the database, I can get the values of the other stuff and display them on those text boxes.
Or is it better to make a button whereby after scanning the bar code value into the card_val text box, a click on the button will make it search for result in the VB.
Thanks in advance.
Saving Text In A Textbox Each Time A User Opens The Program (Notepad Type Prog)
Hi. I want to create a program that is just like Notepad, but has the option of being "always on top."
I'm sort of a newbie at programming so I figure the simplest way to do this would be to make a large textbox on a form with a button to save and a button that makes the form 'always on top.' If anyone has a better idea that would accomplish this (like how to make it look more like the real notepad), I'd love to hear it .
Anyway, besides the possibility of someone suggesting something, what my main question is, how do I make it so when the user presses the 'Save' button the text actually saves and is re-loaded each time I open the program?
What would be the best way to implement this feature?
Thank you,
Brad
Notepad To Access,Grid And Back To Notepad
Hi,
i hav a notepad where there are many lines stored in it.
i need it to separate it as each word(; as separtor).
actually there are 50 columns in Access as backend with various datatypes(49 for data and 1 for end of file........two boxes).
so after 50 countings are identified, it is considered as first record. and then data for second record starts.
after saving to the backend Access, i need to view the content in DataGrid(VB6) where editing of records is permitted.so after editing and while saving it to Access,i need the change to be reflected in Notepad also(with the same format as ; as separator between records and two boxes for end of record).
Plz help me to solve this...............its really urgent!!!
NOTE: Attached one.txt for sample and the backend Access table.
Help File In Notepad
hello again,
I have a help file and I have loaded it into a rtb. (I'm using notepad) I have specific help sections relating to different parts of my program and was wondering if you can bookmark things using notepad so that the user could select the help sections relevant to them. I didn't think you can bookmark using notepad but just thought I'd check if there is a way I don't know about
thanks
Honey_Bear
Saving As A Notepad File
firstly, sorry if this doesn't fit in this catergory.
In my program im making text appear in a text box however i want the user to be able to save the contents of the textbox as a .txt file on their drive.
Thanks for your time. All help is appreciated.
Shelling A .txt File With Notepad
I am wanting to shell notepad and open a .txt file so the user can read the contents, this is my code:
Dim AppError
Dim NotePad, LogFile As String
NotePad = "C:Windows
otepad.exe"
LogFile = (App.Path & "" & "IM_Log.txt")
If Len(Dir$(NotePad, vbDirectory)) <> 0 Then
If Len(Dir$(LogFile, vbDirectory)) <> 0 Then
Open LogFile For Input As #1
Input #1 & vbNewLine, NotePad
Close #1
Else
AppError = MsgBox("No Log File To Open", vbExclamation, "Cannot Locate " & LogFile)
End If
Else
AppError = MsgBox("Cannot Locate " & NotePad, vbCritical, "Error")
End If
And suggestions?? Thanks!
Insert Notepad File VB6
I am trying to make a program in vb6 that checks if emails are valid, I am wondering how I can make it so, a user can insert a list of the emails so the program can check them 1 by 1, So basicly I'm just wondering how can I get a text file (like made by notepad) put into my vb6 application to be used.
Opening Txt File With Notepad
Okay i have a combo box (categories), a textbox (AddNewCategory)
and a button (add2)
The user types in a file name then clicks the button Add2 then that goes to the categories(combobox). Then i want it to be opened in notepad right after its been clicked ( feel free to take the sleep out) I use this code below to do it except when opening Notepad it wont work.
Code:
Private Sub Add2_Click()
Dim fso As New FileSystemObject
Dim Apath As String
Dim Spath As String
Apath = App.Path
Categories.AddItem (AddNewCategory.Text)
fso.CreateTextFile (AddNewCategory.Text & ".txt")
Spath = Apath & "" & AddNewCategory.Text & ".txt"
Sleep 1000
Shell "Notepad" Spath, vbNormalFocus
End Sub
please help!
thanks in advance
How To Open Notepad File
hello every one ..
how to open notepad file....
i'm using
shell (app.path &"
eademe.txt"),vbNormalNoFocus
it give some error ...
so please suggest me what can i do for this purpose ...
anuj
Some Questions About Using Notepad File
Hi everybody,
1- Suppose I have a notepad, and I want to know what is the number of the line which contains the word "Test"... how can I do that?
and what if more than line contain the same word? How can I show no. of all these lines??
2- Can I copy the text in the line no. (20) of the notepad to a text or label?!
Thanks,
Notepad And File Close
I have an option in my app to open a selected text file in notepad which is working OK. What I'm wanting to do is record when the opened file is closed so that I can run some further code.
Any ideas?
Open Notepad File
how do you make Visual Basic open a notepad file?
I need it to open new notepad file every time the command button is clicked.
Open Txt File Using Notepad
I know I have done this before but I want to shell a txt or doc file and open either Notepad (txt) or Word (doc). I can only seem to get the shell command to open the exe file by pointing to it, I thought that if a txt file was associated to notepad by using shell on my txt file Notepad would open automatically.
I know you guys probably have more interesting things to answer but I cannot seem to get past this problem
Thanks
Writing To A Notepad (txt) File
In my vb program I need a way of writing (adding) data to a notepad (txt) file every time the user presses a command button.
there will only be one file where data is added from day to day - so the file size will gradually increase.
Each time data is added, it must be inserted on a new line of the notepad file.
thanx
clax
Open File In Notepad
I have a listview and a dirlist control in my program and i wanna be able to open the selected file in the listview in notepad. i'm using this line to do this:
Shell ("c:windows
otepad.exe"), Dir1.path & "" & ListView1.SelectedItem.Text, "", App.path, 3
what's wrong???? or is there other way to do this????
thax
Create *.txt File ( NotePad )
It look very simple, but …
Can you send me a simple code in VB that doing:
1. create a notepad file ( blabla.txt )
2. open this file
3. write in this file ( " Hello World" )
4. save the file
5. Close the file
Thank's
Saving A File In A Notepad
Hi
i have created an application like a notepad now i want to save the contents typed in by the user into a file like a .txt or .doc file. when the user clicks on the save option of the menu.
Kanchan
Manipulate File In Notepad
Does anyone have any code they coudl shared. I want to open an Avaya cms script in notepad have the code change the date save and close file
Need Some In How To Search A File Iin Notepad.
I'm trying to search, delete, add, edit users from a notepad.
how canI do this.
I have this code so far
Private sub cmdAdd_click()
Dim name As String
name = inputbox(" Enter name" , "Name")
Open "c:My Documentssample.txt" For Input As #1
Input #1, name
picture1.print " The Name that you Added to the notepad is:" name
Close #1
End Sub
how can i work around this with other command buttons.
Any info is good thks
Edited by - xilefagosto on 10/2/2003 5:16:38 AM
Opening A File In Notepad
How does one open Notepad with a given file already loaded into it?
For my purposes, Notepad is always in the same place, and the file of interest, named COUNTER.LOG, is always in the folder of the VB program that wants to give users a look at it.
Louis F. Sander
Pittsburgh, Pennsylvania
U.S.A.
Open A TXT File With Notepad
if I have a TEXT file..I want to open it by Notepad after clicked a button in VB..
how can I do so??
which control should I use?
Thank you
Open File In Notepad
I have a *.txt file listed in a List Box. What is the simplest method to open it in Notepad. Let's say double click on that file in a list box will opens this file.
Thank you.
Open File In Notepad
I would like to know how I can open a text file from vb using Notepad.If I using shell command it will be hard if the notepad.exe in other folder.
Thank You
Using VB To Save An Open Notepad File
Hi,
I was hoping someone might be able to help me with a quick question. I don't have any written code, sorry.
I used the macro recorder to try and save an open notepad file on my desktop but no code appeared in the vb module. Can this be done? I'm a little lost for ideas.
Any help would be greatly appreciated.
Thanks.
Open Text File With Notepad
I would like to open a text file with notepad or wordpad. I tried the shell-function. But that doesnt work.
bool = Shell(notepad "hallo.txt")
It once worked but I forgot how...
Please help!
Anita
Reading And Saving A File (in Notepad)
I am a beginner , who needs a little help!
I want to record input information in a file which can be saved (in the C drive) for reading at a later date when the program is run, for example:
12.50
14.85
16.78
This information is put into an inbox,
How do I open the file in the program (obviously after I've created it)
how can I save it and then read each line of the information so that I can use the information in the program?
Thanks
Carlos
PS Cannot include code this time, apologies
Shellexecute PDF File Opens With Notepad
Can someone please take a look at my code. I'm trying to open a pdf file with the shell execute command and it keeps opening the file up in notepad. I'm going to be loading the file from a shared drive but everyone has acrobat so I figured the shellexecute would be the best bet. Please help.
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Const SW_SHOWNORMAL = 1
Public Function OpenPDF(ByVal PDF As String) As Long
OpenPDF = ShellExecute(0&, vbNullString, PDF, vbNullString, vbNullString, vbNormalFocus)
End Function
Private Sub cmdopen_Click()
Dim sFile As String
Dim filename As String
With cdsave
.DialogTitle = "Open"
.CancelError = False
.Filter = "PDF Files (*.pdf)" & Chr(0) & "*.PDF" & Chr(0)
.ShowOpen
If Len(.filename) = 0 Then
Exit Sub
End If
filename = .FileTitle
sFile = .filename
End With
OpenPDF (sFile)
End Sub
Auto Save Of Notepad File
i have an existing notepad file which will be opened manually and updated often by user. i want to save this from vb.. can anybody send the code for auto save the text file
Opening A Text File Using Notepad
I've made a help text file that I want to be accessed through the menu, and when the menu item is clicked. I'd like the text file to be opened in Notepad while my Visual Basic program is still running, similar to what would happen if you double clicked the text file in Windows Explorer. What sort of syntax do I need to use?
How To Make A Notepad File Pop Up On Screen?
hi...I have a simple qn here which I need help on...
My VB program allows values in textboxes to be written to a NOTEPAD file called testfile in my :C drive. I would like this testfile to pop up and appear centrally on the screen whenever I click on a command button. Whats the simplest code to achieve that?
I used
Shell "C:/testfile.exe"
Shell "C:/testfile.txt"
Shell ("C:/testfile.exe")
Shell ("C:/testfile.txt")
all of which did not work
Many thanks
|