Sometimes folder renaming code works, sometimes it doesn't ?

G

gil

Hello All,

Sometimes folder renaming code works, sometimes it doesn't. I cannot seem to figure out what changes. It'll work for 5 minutes, then not work.



Dim OldName, NewName

OldName = "C:\Patients": NewName = "c:\Patie333"

Name OldName As NewName



I'm losing it. ;) Any ideas what I might be missing?

TIA,

Gil
 
J

Jonathan West

Is there an open file in the folder?


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup


Hello All,
Sometimes folder renaming code works, sometimes it doesn't. I cannot seem
to figure out what changes. It'll work for 5 minutes, then not work.

Dim OldName, NewName
OldName = "C:\Patients": NewName = "c:\Patie333"
Name OldName As NewName

I'm losing it. ;) Any ideas what I might be missing?
TIA,
Gil
 
G

gil

Well, Jonathan . it might be that there was a file in the folder after all . sort of. It just hadn't been named yet. The code was
springing from an install.dot file I had made. And it depended on whether install.dot was activated w/o another file being open in
a different folder or not.



It seems fixed by adding the first line below:



ChangeFileOpenDirectory "C:\TSMRunzipTemp"

Dim OldName, NewName

OldName = "C:\Patients": NewName = "c:\Patie333"

Name OldName As NewName



Install.dot was at step one of starting a new document, which could have been in one of several folders. Sometimes it was going to
be in the folder whose name I was changing.



Thank you for your assistance. I've not been in the habit of using F8 to step through. I'll give it a try. :)



Gil

Cheers . Gil

Gil Carter, MD, JD

60 second peek movies of TSMR in regular use: http://www.TenSecondMedicalRecord.com, the premium & most versatile EMR, in regular
use since 1990; pre-TSMR2008 versions remain free; uses Microsoft Word; can be used as an adjunct to other EMR programs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top