|
-
Aug 8th, 2004, 03:45 PM
#1
Thread Starter
Fanatic Member
cut lines of text(specific)
--------------------------------------------------------------------------------
I cant seem to find how to simply select a certain number of lines, in a text.
Dim PadId As Integer
On Error Resume Next
PadId = Shell("Notepad MyFile", 1)
AppActivate(PadId)
'select and cut lines 1 thru x. ??? I already have the line counter x.
'paste elsewhere
'save file
'close file
Thanks in advance!
-
Aug 8th, 2004, 04:00 PM
#2
Do you have to do this with NotePad? It would be much easier to open the file within the VB code and process data there.
-
Aug 8th, 2004, 04:25 PM
#3
Thread Starter
Fanatic Member
yes and no
Well any example is nice but, I would prefer it done this way.
Some temporary Internet files, and cookies do not always delete through microsoft code.
-
Aug 8th, 2004, 04:49 PM
#4
You could do this to cut the text,
VB Code:
Private Sub GetText(ByVal numOFlines As Integer, filename As String)
Dim strData As String
Dim i As Integer
Dim slen As String
Open filename For Input As #1
For i = 1 To numOFlines
Line Input #1, slen
strData = strData & slen & vbCrLf
Next i
Close #1
End Sub
To paste elsewhere just open a new file for output then print strData.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|