By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 2,086 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

How do I rename a file's extension

P: n/a
I found the transfertext function and found that it bombs if I do not use
the extension "txt". But the application I am writing the info for has a
different file extenstion. What VBA command will rename the file once it is
written?
Thanks
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Name C:\MyFolder\MyFileName.XXX As C:\MyFolder\MyFileName.txt
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"Colleyville Alan" <ae***********@nospam.comcast.net> wrote in message
news:t%CQb.144814$na.232923@attbi_s04...
I found the transfertext function and found that it bombs if I do not use
the extension "txt". But the application I am writing the info for has a
different file extenstion. What VBA command will rename the file once it is
written?
Thanks

Nov 12 '05 #2

P: n/a
The Name statement.

Name "C:\File.txt" As "C:\File.dat"

It is possible, by the way, to get around the .txt restriction. See the
following KB articles:
http://support.microsoft.com/?id=245407
http://support.microsoft.com/?id=306144

(While they refer to importing, the same is true for exporting)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

"Colleyville Alan" <ae***********@nospam.comcast.net> wrote in message
news:t%CQb.144814$na.232923@attbi_s04...
I found the transfertext function and found that it bombs if I do not use
the extension "txt". But the application I am writing the info for has a
different file extenstion. What VBA command will rename the file once it is written?
Thanks

Nov 12 '05 #3

P: n/a
You forgot the quotes.

Name "C:\MyFolder\MyFileName.XXX" As "C:\MyFolder\MyFileName.txt"

or

Dim strFileOld As String
Dim strFileNew As String

strFileOld = "C:\MyFolder\MyFileName.XXX"
strFileNew = "C:\MyFolder\MyFileName.txt"
Name strFileOld As strFileNew
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

"PC Datasheet" <sp**@nospam.spam> wrote in message
news:hh***************@newsread3.news.atl.earthlin k.net...
Name C:\MyFolder\MyFileName.XXX As C:\MyFolder\MyFileName.txt
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"Colleyville Alan" <ae***********@nospam.comcast.net> wrote in message
news:t%CQb.144814$na.232923@attbi_s04...
I found the transfertext function and found that it bombs if I do not use the extension "txt". But the application I am writing the info for has a different file extenstion. What VBA command will rename the file once it is written?
Thanks


Nov 12 '05 #4

P: n/a

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:Xm*********************@news04.bloor.is.net.c able.rogers.com...
You forgot the quotes.

Name "C:\MyFolder\MyFileName.XXX" As "C:\MyFolder\MyFileName.txt"

or

Dim strFileOld As String
Dim strFileNew As String

strFileOld = "C:\MyFolder\MyFileName.XXX"
strFileNew = "C:\MyFolder\MyFileName.txt"
Name strFileOld As strFileNew


Thanks.
But as regards the KB articles, I'll pass on modifying the windows registry.
I am developing this at home but will be showing a demo at work and I dont
want to mess with that registry.
Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.