FileCopy

N

Nairda

Hi all

I am trying to make some cosmetic changes to an existing Word macro,
specifically amending organizational re-branding. So no changes have been
made to functionality or logic. Just titles have been amended and then the
macro saved within the VBA editor.

The main template uses FileCopy to copy .DOT files to specific locations.
The two locations specified are the default templates directory;

"D:\Documents and Settings\User Profile\Application Data\Microsoft\Templates\"

and the default startup directory;

"D:\Documents and Settings\User Profile\Application
Data\Microsoft\Word\Startup\"

The following code works fine with Word versions up to and including 2003
but not 2007. For some reason, the error message generated implies that
there is an issue with write access;

FileCopy "PCLET.DOT", startuppath$ + "PCLET.DOT"

Where "PCLET.DOT" is being copied from C:\WINDOWS and startuppath$ is equal
to the default startup directory path.

When run in Word 2007, the template IS copied to the specified location as
the code suggests, but the error is generated.

Does anyone please have any ideas as to why this may be the case?

The same .DOT works fine with Word 2003 and the existing, unamended,
template runs to completion within Word 2007.

Many thanks for any assistance.
 

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