M
Mr. Smart
Initially it may seem i am posting to a wrong group, but I am convined I am
not. I know the problem is coming from VBA's SaveAs. This is what I am trying
to do: I am writing a resume-generating program which I want to use to
respond to different jobs. For example, let's say there are 5 jobs. I want to
save the resumes using a name such as Adenigba Smart's Resume.doc. Here is a
code that I used. I used Foxpro to drive Word (it is part of a larger
program).
....
SCAN ** Scans thru the database
....
THIS.CVName = THIS.DocumentFolder + "\" + TRIM(Surname) + "\"
Trim(Firstname) + "'s Resume.doc"
....
ENDSCAN
For those that are not familiar with foxpro, I am sure you will be able to
follow thru. It simply gives a name to the document based on applicant's
name. The first time thru, it works OK, but after this it fails. The problem
occurs in the THIS.oWordoc.SaveAs(by the way, it simply calls VBA's SaveAs).
It returns the error message: OLE IDispatch exception code 0 from Microsoft
Word: This file is read-only and will not overwrite it. I tried to delete the
file using Foxpro's DELETE FILE. It failed. Since it contained of being read
only, i tried to change the read only status by using FileSystemObject (FSO )
to change to normal before deleting, but did not work (by the way, I used
Explorer to examine it, but it was not read-only). Since this code always
work the first time, I also try shutting down Word and re-starting, it also
failed. Please thus anybody out there know how to do this seemingly simply
task. How do I save this file successfully? By the way, I use Foxpro 6 on
Windows XP version 2002. Word XP. Thanks 4 your anticipated response
not. I know the problem is coming from VBA's SaveAs. This is what I am trying
to do: I am writing a resume-generating program which I want to use to
respond to different jobs. For example, let's say there are 5 jobs. I want to
save the resumes using a name such as Adenigba Smart's Resume.doc. Here is a
code that I used. I used Foxpro to drive Word (it is part of a larger
program).
....
SCAN ** Scans thru the database
....
THIS.CVName = THIS.DocumentFolder + "\" + TRIM(Surname) + "\"
Trim(Firstname) + "'s Resume.doc"
....
ENDSCAN
For those that are not familiar with foxpro, I am sure you will be able to
follow thru. It simply gives a name to the document based on applicant's
name. The first time thru, it works OK, but after this it fails. The problem
occurs in the THIS.oWordoc.SaveAs(by the way, it simply calls VBA's SaveAs).
It returns the error message: OLE IDispatch exception code 0 from Microsoft
Word: This file is read-only and will not overwrite it. I tried to delete the
file using Foxpro's DELETE FILE. It failed. Since it contained of being read
only, i tried to change the read only status by using FileSystemObject (FSO )
to change to normal before deleting, but did not work (by the way, I used
Explorer to examine it, but it was not read-only). Since this code always
work the first time, I also try shutting down Word and re-starting, it also
failed. Please thus anybody out there know how to do this seemingly simply
task. How do I save this file successfully? By the way, I use Foxpro 6 on
Windows XP version 2002. Word XP. Thanks 4 your anticipated response