VB code works in word97, but not word 2003

R

red6000

I have the following code:

ActiveDocument.SaveAs FileName:="My File" + format(Now, "dd mm yy hh mm ss")

which works perfectly in word 97, but when run in word 2003 it gives the
error:

Compile error:
Wrong number of arguments or invalid property assingment.

Can anyone help on how to get this to work in word 2003.

Thanks.
 
J

Jay Freedman

I don't know what's happening on your system, but a macro made by
copying and pasting that line runs perfectly well here (Word 2003 SP1
on Windows XP).

Just as a matter of convention, the catenation operator (for sticking
two strings together) should be '&' instead of '+', but as a practical
matter either of them will work.

--
Regards,
Jay Freedman
Microsoft Word MVP

Replace the + operator with an & operator.
 

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