A
aalaan
Hi all
Word 2000. Complete beginner.
Trying to automate the current process of leaving Word and going into
Windows Explorer to copy files that have just been worked on to a memstick
(removable media). This is because one should never *save* to a memstick.
I'm trying to automate this from a special button on the Word toolbar while
actually in a given document. I know a file must be actually there on the
hard disk (ie first saved to the hard disk) and then it should be possible
to copy it. However, doing it from inside the document means that the system
thinks the document is still in use and refuses to copy it (copying an'open'
file). How can I overcome this?
I'm familiar with assigning a vba routine to a new toolbar button.
Here is the code I'm using:
Dim strFileA, strFileB
strFileA = ActiveDocument.Name 'so as know the name of the
document being copied
ActiveDocument.Close 'so the system thinks
it is still not open
strFileB = "F:\" & strFileA 'the path of the
desired copy
FileSystem.FileCopy strFileA, strFileB 'overwrite by default
I get 'permission denied' which I guess is the system saying this file is in
use (and therefore locked).
Any help would be appreciated.
Word 2000. Complete beginner.
Trying to automate the current process of leaving Word and going into
Windows Explorer to copy files that have just been worked on to a memstick
(removable media). This is because one should never *save* to a memstick.
I'm trying to automate this from a special button on the Word toolbar while
actually in a given document. I know a file must be actually there on the
hard disk (ie first saved to the hard disk) and then it should be possible
to copy it. However, doing it from inside the document means that the system
thinks the document is still in use and refuses to copy it (copying an'open'
file). How can I overcome this?
I'm familiar with assigning a vba routine to a new toolbar button.
Here is the code I'm using:
Dim strFileA, strFileB
strFileA = ActiveDocument.Name 'so as know the name of the
document being copied
ActiveDocument.Close 'so the system thinks
it is still not open
strFileB = "F:\" & strFileA 'the path of the
desired copy
FileSystem.FileCopy strFileA, strFileB 'overwrite by default
I get 'permission denied' which I guess is the system saying this file is in
use (and therefore locked).
Any help would be appreciated.