Results 1 to 2 of 2

Thread: File type

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2000
    Location
    Staffodshire, England
    Posts
    32
    A part of the program im working on at the moment allows the user to rename files, but when they do this the file type is lost, can anyone tell me how to keep the file type, or even if it will work, how to keep the last 3 letters(filetype) of the old name.

  2. #2
    Addicted Member
    Join Date
    Feb 2000
    Location
    London, UK
    Posts
    145
    Dim OldName, NewName As String
    'In OldName you store the old filname, for
    'instance "test.txt"
    'In Text1 the user inputs the new name, without the last three letters.
    NewName = Text1.Text & Rigth(OldName, 4)


    If OldName is "Test.txt" and the user writes "Newfile" in Text1 NewName will be "Newfile" & ".txt" = "Newfile.txt"


    Hope it helps.
    Pentax
    Wilhelm Tunemyr,
    Swede in London

    [email protected]

    "Dort, wo man Bücher verbrennt, verbrennt man am Ende auch Menschen"
    Heinrich Heine (1797-1856)

    Pravda vítezi!
    (Truth prevails!)

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