Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2005

Tip: Looking for answers? Try searching our database.

vb code works in word 97 but not word 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
red6000 - 16 Apr 2005 23:12 GMT
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.
Jezebel - 17 Apr 2005 02:20 GMT
You're adding a number to a string where you should be concatenating -- the
result is thus not a string, which is the required argument type. Try

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

>I have the following code:
>
[quoted text clipped - 10 lines]
>
> Thanks.
red6000 - 17 Apr 2005 10:28 GMT
> You're adding a number to a string where you should be concatenating --  
> the result is thus not a string, which is the required argument type. Try
>
> ActiveDocument.SaveAs FileName:="My File" & format$(Now, "dd mm yy hh mm
> ss")

Thanks, but if I use that I now get;

Compile error:

Type-declaration character does not match declared data type.
Howard Kaikow - 17 Apr 2005 18:02 GMT
> You're adding a number to a string where you should be concatenating -- the
> result is thus not a string, which is the required argument type. Try
>
> ActiveDocument.SaveAs FileName:="My File" & format$(Now, "dd mm yy hh mm
> ss")

Although the OP should be using an & instead of a +, that's not the problem
here.

The statement presented works properly in Word 2003 with either the + or the
&.
Some other statement is causing the problem.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.