Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 18013
Number of posts: 55386

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Renaming a filename Posted by Trampas on 25 Apr 2005 at 7:14 AM
I am using VB6.

I am trying to rename a .fni file to .tiff

I am using the File System Object method to do it.

Can someone help

What I have done is

If InStr(oAttachment, ".fni") > 0 Then
I have been looking at
fsoChangeFileName.MoveFile name of the old file and new file.
I thought this only works for the name of file and not the extension.

End If

oAttachment.WriteToFile (strPath & oAttachment)

Can someone help me please
Thanks in advance
Gareth
Report
Re: Renaming a filename Posted by dokken2 on 25 Apr 2005 at 8:46 AM
: I am using VB6.
:
: I am trying to rename a .fni file to .tiff
:
: I am using the File System Object method to do it.
:
: Can someone help
:
: What I have done is
:
: If InStr(oAttachment, ".fni") > 0 Then
: I have been looking at
: fsoChangeFileName.MoveFile name of the old file and new file.
: I thought this only works for the name of file and not the extension.
:
: End If
:
: oAttachment.WriteToFile (strPath & oAttachment)
:
: Can someone help me please
: Thanks in advance
: Gareth
:


You could use the intrinsic "Name" statement to rename the file.
Report
Re: Renaming a filename Posted by BitByBit_Thor on 25 Apr 2005 at 8:56 AM
: : I am using VB6.
: :
: : I am trying to rename a .fni file to .tiff
: :
: : I am using the File System Object method to do it.
: :
: : Can someone help
: :
: : What I have done is
: :
: : If InStr(oAttachment, ".fni") > 0 Then
: : I have been looking at
: : fsoChangeFileName.MoveFile name of the old file and new file.
: : I thought this only works for the name of file and not the extension.
: :
: : End If
: :
: : oAttachment.WriteToFile (strPath & oAttachment)
: :
: : Can someone help me please
: : Thanks in advance
: : Gareth
: :
:
:
: You could use the intrinsic "Name" statement to rename the file.
:

Or you could just use VB's own FileCopy


Greets...
Richard




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.