|
-
Apr 5th, 2000, 05:10 PM
#1
Thread Starter
New Member
Bit of stupid one i'm afraid - i'm running some vb in excel and want to cut and paste the resulting data in to notepad and then save it - anyone able to help???
Thanks
John
-
Apr 5th, 2000, 08:01 PM
#2
Frenzied Member
Why not just save the text directly into a .txt file;
Open "myfile.txt" for Output as #1
Print #1, [whatever text you want to]
Close #1
If I'm missing the point you could always try;
Clipboard.SetText "[the text]"
Shell "notepad.exe", vbNormalFocus
SendKeys "%V",True 'to paste the text
SendKeys "%FS",True 'to save the file
This should prompt the user for the filename - if you want to fill this in automatically you could try adding
SendKeys "filename.text{ENTER}",True
To close notepad;
SendKeys "%{F4}",True
I haven't tested this second solution so it may not work..
'Buzby'
Visual Basic Developer
"I'm moving to Theory. Everything works there."
-
Apr 5th, 2000, 08:15 PM
#3
Thread Starter
New Member
thanks for this - i think that i haven't explained what i need very well. i'm using excel to format a load of data so that the data appears in in lines of 75bytes (punchcard!)what i need to be able to do is a straightforward cut and paste so that the formatting is preserved (as it is if you do it manually). Then i'm going to save the notepad file and write a script to feed it in to a dbase (flatfile nightmare) that i'm working with. I can't unfortunately just drop data into backend tables.....so this is my best workaround at the moment. I considered doing the formatting in PFE but writing the macro turned out to be a nightmare....
thanks
John ; )
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
|