ActiveDocument.SaveAs 
Author Message
 ActiveDocument.SaveAs

Can anyone help please...
I am trying to save down the active document.When I use
ActiveDocument.SaveAs ("xxx.doc")
or ActiveDocument.SaveAs FileName:="xxx.doc"
it works fine. But I am trying to assign the name to a
variable e.g.

SaveName= TemplatePath & "\" & FilNam & ".doc"

I have then tried
ActiveDocument.SaveAs (SaveName)
ActiveDocument.SaveAs Filename: = SaveName

but all I get is error 5487 file permission error.
Any suggestions please



Fri, 10 Dec 2004 06:17:42 GMT  
 ActiveDocument.SaveAs
Try putting

MsgBox "[" & SaveName & "]"

Just before the .SaveAs command to see what you're actually feeding the Save
command. It sounds like you've got a bad filename string. Does your
TemplatePath variable by any chance end with a "\"? If so, you've got two
backslashes together.

--

Pete

This e-mail address is fake to keep spammers and their auto-harvesters out
of my hair. If you need to get in touch personally, I am 'pdanes' and I use
Yahoo mail. But please use the newsgroups whenever possible, so that all may
benefit from the exchange of ideas.


Quote:
> Can anyone help please...
> I am trying to save down the active document.When I use
> ActiveDocument.SaveAs ("xxx.doc")
> or ActiveDocument.SaveAs FileName:="xxx.doc"
> it works fine. But I am trying to assign the name to a
> variable e.g.

> SaveName= TemplatePath & "\" & FilNam & ".doc"

> I have then tried
> ActiveDocument.SaveAs (SaveName)
> ActiveDocument.SaveAs Filename: = SaveName

> but all I get is error 5487 file permission error.
> Any suggestions please



Fri, 10 Dec 2004 13:13:14 GMT  
 ActiveDocument.SaveAs

try examining the SaveName just before saving it. Either use a msgbox
or place a break point just before.


this:

Quote:
>Can anyone help please...
>I am trying to save down the active document.When I use
>ActiveDocument.SaveAs ("xxx.doc")
>or ActiveDocument.SaveAs FileName:="xxx.doc"
>it works fine. But I am trying to assign the name to a
>variable e.g.

>SaveName= TemplatePath & "\" & FilNam & ".doc"

>I have then tried
>ActiveDocument.SaveAs (SaveName)
>ActiveDocument.SaveAs Filename: = SaveName

>but all I get is error 5487 file permission error.
>Any suggestions please

Steve Hudson - Word Heretic, Sydney, Australia
{*filter*} teacher, trainer, tutor, writer, developer

You agree by writing to me personally that any material can be reused publicly unless you explicitly disclaim it. (For List and blog use.)


Thu, 23 Dec 2004 21:05:34 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. WordApp.ActiveDocument.SaveAs does not work -office2000

2. How do I DDEPoke ActiveDocument.Name?

3. Still get Save document question after WordApplication.ActiveDocument.Close(wdDoNotSaveChanges)

4. Excel acting as an ActiveDocument Server for Internet Explorer

5. ActiveDocument.mailmerge syntax not working

6. ActiveDocument.Scripts Example

7. ActiveDocument with Bound OLE?

8. Bound OLE with ActiveDocument w/o Word?

9. How to post the ActiveDocument using Word VBA

10. Need helpfor Error 4605 - ActiveDocument.Close fails.


 
Powered by phpBB® Forum Software © phpBB Group