From: GaryAF on
I'm attempting to open a Word document from local disk, modify contents of
embedded fields, and save the modifed document using the .saveas method. Code
looks like:

set wrdDoc = wrdApp.Document.Open("C:\foldername\doc1.doc")
wrdFileName = "C:\foldername\doc2.doc"
Call wrdDoc.SaveAs(wrdFileName)
wrdDoc.Close (false)
wrdApp.Quit

Doc1 opens, the fields get updated, and Doc2 gets written back to the local
folder. The application was developed on an XP system -- Word 2000. When I
create the distribution package and install it on a Vista desktop -- Word
2007 -- that has VB6 loaded, it runs like a swiss watch. Perfect. When I
install the same package on a Vista system that does not have VB6 loaded, the
..SaveAs method fails. msword.olb (Office 11 version) is loaded in the
application folder when the application is installed on the target system.

Does anyone have any tips on what I can do to get around this problem?


From: MikeD on


"GaryAF" <GaryAF(a)discussions.microsoft.com> wrote in message
news:543D7D77-8EBD-4C3D-8A93-7D978F8E9993(a)microsoft.com...
> I'm attempting to open a Word document from local disk, modify contents of
> embedded fields, and save the modifed document using the .saveas method.
> Code
> looks like:
>
> set wrdDoc = wrdApp.Document.Open("C:\foldername\doc1.doc")
> wrdFileName = "C:\foldername\doc2.doc"
> Call wrdDoc.SaveAs(wrdFileName)
> wrdDoc.Close (false)
> wrdApp.Quit
>
> Doc1 opens, the fields get updated, and Doc2 gets written back to the
> local
> folder. The application was developed on an XP system -- Word 2000. When I
> create the distribution package and install it on a Vista desktop -- Word
> 2007 -- that has VB6 loaded, it runs like a swiss watch. Perfect. When I
> install the same package on a Vista system that does not have VB6 loaded,
> the
> .SaveAs method fails. msword.olb (Office 11 version) is loaded in the
> application folder when the application is installed on the target system.
>


Sounds to me like on this 2nd Vista system, Word is not installed. Word MUST
be installed to use automation with it. It also sounds like you distributed
the msword.olb file. You can't do that. It's not legal and it does you no
good anyway (as you've found out).

--
Mike