Open A Notepad With Shell???
i know it but i forgot. please what was it again?
shell ("C:ote......?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Open Notepad With Shell Command
The following works fine in my uncompiled program. But after compiling I get an error message that the About.txt can't be found. Is there a way of specifying the path:app with or without Shell to open the notepad file?
Code:
Shell "Notepad About.txt", 1
Stan
Using Shell To Open Notepad With A File
Yo yo yo
I want to use shell to open notepad and then open a file within notepad
the only thing that I have is
Code:
Shell ("Notepad")
now I need to somehow use my app to open a file in notepad
any Ideas?? (Im using vb6)
Use Shell To Open Notepad With A Filepath That Is Not Hardcoded
Currently, I have a call to launch Notepad with a particular textfile.
Shell "Notepad C ProgramFiles est1.txt",vbNormalFocus
But I don't want the path to be hardcoded. How would I insert the variable into the code eventhough the quotes extend from Notepad to the end of the file string?
For example,
path=txtbox1.text
filepath would be path & " est1.txt"
Thank you.
Set Notepad Font Type Before Open It Using "Shell" Command.
May i know whether i can set the font type and font size
of application Notepad before i open it in VB using command
"shell"?
If i didn't set the font type, the file opened will run out of
alignment......
Thanks for any help.
Regards,
SF
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
Shell-Notepad
I want to open notepad from my app as 'modal window'
Shell Notepad
I am confused to why this shell statement with the app.path cannot find the file File.txt? File.txt IS in the same folder as the exe..
Shell "Notepad.exe" & App.Path & "File.txt", 1
Shell: Notepad
i cant get this shell to work i have:
Shell "Notepad app.path help.txt", vbNormalFocus
Shell To Notepad Not Working
I am trying to shell to notepad the html of a webpage. When I get about 3 or 4 lines in, theres an error:
Run time error '5':
Invalid Procedure Call or Argument
Here is the code I am using:
Code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub StartNote(text As String, Speed As Integer)
a = Shell("notepad.exe", vbNormalFocus)
For i = 1 To Len(text)
Sleep (Speed)
SendKeys Mid(text, i, 1), 1
Next i
End Sub
Private Sub Command1_Click()
StartNote WebBrowser.Document.documentElement.outerHTML, 10
End Sub
Any Ideas on why it starts out fine, and then encounters an error?
Open Dialog To Open Text File With Notepad?
Hello,
Can someone please help me to open a text file with the Common Dialog control? I have seen your tutorial and it makes sense, but it uses a rtb control instead of opening the file with notepad as i would like.
HERE IS CURRENT CODE:
(Other properties were setup in properties pages)
Private Sub Command1_Click()
cdlOpenFile.Filter = "Text File (*.txt)|*.txt|All Files|*.*"
cdlOpenFile.ShowOpen
End Sub
THANKS!!!
Opening Files (txt) In Shell (notepad)
Hi there,
Just putting the finishing touches to a program and I've written a readme file that I want the users to access by clicking on a menu within the program.
I've got it working fine but I'd like a message box or something to come up if the specified readme file is missing - maybe a CommonDialog box to browse to it?
The code I have at the moment i:
Code:
Private Sub mnu_readme_Click()
Dim help As Integer
'opens up readme file in notepad
help = Shell("Notepad.exe " & App.Path & "
eadme.txt", vbNormalFocus)
End Sub
If the readme file is not there or renamed then Notepad opens but then a Notepad msgbox comes up telling me it can't find the file I want, would I like to create a new file? Yes/No/Cancel
I mean ideally the readme file will always be there but best to cover all bases....
Is there a way to ONLY get it to open readme.txt before it launches Notepad and test to see if it's the correct file?
Anyways, hope there's a solution out there!
Many thanks,
Alex
Shell Html Source To Notepad
I have the following code to open the source for html website in notepad
VB Code:
Public Function DownloadFile(URL As String, _ LocalFilename As String) As Boolean Dim lngRetVal As Long lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0) If lngRetVal = 0 Then DownloadFile = TrueEnd Function Private Sub mnuSource_Click()DownloadFile frmmain.web1.LocationURL, "C: emp.txt"Shell "notepad.exe C: emp.txt", vbNormalFocuskill "C: emp.txt"End Sub
How does IE do it so that the html source is more organized?
this just puts a big bunch of lines together
no formatting or anything
hard to read.
Anyone know how IE does it?
Open Like Notepad
Hi!
If I open a file (eg. *.wav) using the methods used in some threads in this forum,
it only displays some lines.
But if I open the file in Notepad, it's much bigger!
How can I open ANY file COMPLETELY?
PS_For some reason, *.txt works, but not the other extensions...
Open Notepad
hello.. i need a code on how to open an existing file (*.txt) to be exact. i have my textbox which is the path of where the file is located.. thanks
Open Notepad!
I am using the Microsoft Internet Control (WebBrowser control) in a VB6 application. How do I open NotePad when a menu item is clicked?
Thanks,
Arpan
Open To Notepad
How can I open a text file directly to notepad using vb code???
thanks,
vbk
Open NotePad
Hello
This should be easy. What is the syntax to open a file with notepad?
something (NotePad,"c:MyFile.txt")
Anybody know? I've looked in the MSDN and have found nothing?
Thanks
-William
Open Notepad
Nothing fancy, I just want to open notepad visually. Is it something like:
Shell.exe "C:WinNT
otepad.exe"?
Code To Open Notepad?
Hey guys I have a txt file, and I can open it into a text box, but for this file I would like it so if a user clicked on a button, it would open the file up in notepad. Is there a way to do that? Thank you!
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
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
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
How To Open Files Within Notepad
Hello people, i am hoping you can help me, how can i get my VB program to open files within notepad, i.e. a .CDF file to open within Notepad, i am aware of how to use the shell function to actually open notepad, however using this i cannot open normal files, only executables.
Please help
Many thanks
How To Open Notepad.exe Through SQL Command
Dear Friends,
By using sp_oacreate with filesystemobject I can write the values in notepad. But I want to open the notepad exe in through sql command.
It is possible give ur valuable guidance to me
with regards,
anas danie r a
Open A Notepad Program
i have using this coding....
Code:Public 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
Private Sub cmdExecute_Click()
ShellExecute hwnd, "open", "C:Documents and SettingsMaxDesktopvbpowervb powerJeffCal.txt", vbNullString, "C:", 1
enb sub
but the coding have some problem....
error message: Only comments may appear after end sub,end function or end property
Open A Notepad Program
i wish to open a notepad application that i have specified .....like C: est.txt....when i click on the command button...the notepad program will promt up and show the containe of the test.txt
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 Notepad At A Line Number
I have a program that reads data in from a txt file, but first it reads the file to check for any inconsitancies, if one is found it doesn't execute the routine and tells them that there is an inconsitancy and what line number it is on. I then ask if they want to open notepad to view it. I was wondering if there is a way that I can get notepad to open with the cursor already on that line number. My thought was that there must be some sort of command line argument or switch.
Thanks for any help.
Derek
Open Notepad With Variable Title
Hi.
For a project im doing, im keep records of local garages. Every time i add a garage to the database a notepad document is created and saved with the garage id.
The user has the option to view these notepad documents. When the relevant button is clicked, an inputbox appears which will take the required garage id. Using this input, i want to be able to open the specific txt file which has the input for a title. This is my code atm:
Dim id1 As Integer
id1 = Val(InputBox("Enter Garage ID"))
If id1 = 0 Then
Else
Dim shell, fsco
Set shell = CreateObject("WScript.shell")
Set fsco = CreateObject("Scripting.FileSystemObject")
shell.run = """notepad"""
end if
can anyone tell me how i can open notepad using this variables value as a title. thanks
Open Acrobat Reader Or Notepad [VB6]
I need to code the following pseudo code in VB6; any help would be appreciated.
If Acrobat Reader is installed then open c: est.pdf
Else if Notepad is installed then open c: est.txt
Otherwise Message box, no application able to load information
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
Open A Text File (in Notepad) From VB
Hello,
I want to open a specific text file from within VB. For example, by clicking a button. I have tried ShellExecute..but it does not seem to work.
Help.
Thanks!
Open Notepad With Variable File Name???
Hi
Im having yet another problem with using variable filenames. I want the user to be able to open a existing text file in notepad by clicking a button. The filename is stored as a string. Heres what im trying:
VB Code:
Private Function viewFile() If Right(appPath, 1) <> "" Then appPath = appPath & ""strPath = appPath & "moods" & songTitle & " mood.txt"Shell "notepad.exe" & strPath, vbNormalFocusEnd Function
However i get a file not found error. The file exists, (im not checking this at the moment but will do if i can get this working).
Is there a way to do this?
Thanks
Open Text File In Notepad
My application generates a number of .Log files. All are standard text files that I can easily view in Notepad. What I'd like to do is add a menu item which, from within my program, my user to open them and view them, in notepad. I've tried:
VB Code:
Shell "c:myfoldermylog.log", vbNormalFocus'and I have triedShell "notepad.exe c:myfoldermylog.log", vbNormalFocus
And neither one works. What am I doing wrong?
Open Acrobat Reader Or Notepad [VB6]
I need to code the following pseudo code in VB6; any help would be appreciated.
If Acrobat Reader is installed then open c: est.pdf
Else if Notepad is installed then open c: est.txt
Otherwise Message box, no application able to load information
Thanks,
|