Kman_59624
Wed May 09 13:06:11 CDT 2007
On May 9, 1:01 pm, "Richard Mueller [MVP]" <rlmueller-
nos...@ameritech.nospam.net> wrote:
> <Kman_59...@yahoo.com> wrote in message
>
> news:1178730471.533045.227690@e65g2000hsc.googlegroups.com...
>
>
>
>
>
> > Hello all, Looking for a little help all the examples in MSDN have
>
> >Doc.saveas("Myfile.doc")
>
> > I want to use a variable and haveing tried such, it is just not
> > working.
>
> >doc.saveas(strMyDocs & "\" & ResID & ".doc")
>
> > I have tried stuffing all into one variable and splitting it out into
> > many but to no avail.
> > but if I hardcode it ....
> > All the variables have the correct data
> > I am thinking that as soon as SAVEAS is called the Vars loose their
> > ohhh whats the word.... "scope"/"meaning" ..
>
> I've never had problems with SaveAs (Excel objects), but I believe the file
> name should not be in parentheses (unless you Call the SaveAs method). Try:
>
> doc.saveasstrMyDocs & "\" & ResID & ".doc"
>
> Makes sure the argument is a valid filename, and if not in the current
> folder, a valid path and file name. The file should not exist, or you will
> be asked if you want to replace the existing file. To troubleshoot, use:
>
> Wscript.Echo strMyDocs & "\" & ResID & ".doc"
>
> to make sure the argument is valid. Also, after saving, I would close the
> document and quit the application. Otherwise, the document can be held open
> in memory, which causes problems such as not being able to save. You might
> use Task Manager to make sure Word (or whatever app) is not running in
> memory, holding the file open.
>
> --
> Richard Mueller
> Microsoft MVP Scripting and ADSI
> Hilltop Lab -
http://www.rlmueller.net
> --- Hide quoted text -
>
> - Show quoted text -
Thanks I will give it a shot and all the other items are all ready
there , left them out for neatness (fairly big script) .