Results 1 to 3 of 3

Thread: notepad

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    6
    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

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    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."

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    6
    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
  •  



Click Here to Expand Forum to Full Width