|
Brett
You can actually access your COM object on a
seperate machine than your web server. Just have to specify 'remote' in
the context attribute and make sure your CF server is logged in as administrator
under services. You also have to access is via the ClassID instead of the
ProgID. (You can find the ClassID's of installed apps under
\HKEY_CLASSES_ROOT\CLSID\)
<cftry>
<!--- try to connect to the object ---> <cfobject action="CONNECT" class={00020900-0000-0000-C000-000000000046} name="objWord" type="COM" context="REMOTE" server="\\myservername"> <cfcatch> <!--- object hasn't been created, so create one ---> <cfobject action="CREATE" class={00020900-0000-0000-C000-000000000046} name="objWord" type="COM" context="REMOTE" server="\\myservername"> </cfcatch> </cftry> <cfscript> objDocuments = objWord.Documents; myDocument = objDocuments.Add(); myDocument.SaveAs("c:\testDocument.doc"); </cfscript> Just go to the object model def at msdn to get all
the goodies on methods and props.
The above code just executes the creation of the
object and saves a document file locally. Of course you can do all the
clever features of word. One of my favorites is using it not to create
word docs, but instead leech the spell checker capability out of it for my web
apps. =D Once made a web based thesaurus in about 10
minutes even - lol.
By the way, Microsoft not only does not support
server-side automation of the office tools, the detest it. (but not in violation
of any user agreements as in some cases "unavoidable") Mwuhahahahaha - all
the more reason to do it! >=)
Whats up with makin me use my brain on the
weekend? Phhhhttt..... Pass the Ziegen.
=P
Nate Nielsen
817.726.8644
|
- Dynamically Generate MS Word Files.. Brett T. Smith
- Re: Dynamically Generate MS Word Files.. Nate Nielsen
- Re: Dynamically Generate MS Word Files.. Brett T. Smith
- Re: Dynamically Generate MS Word Files.. Robert Julian Browning
- Re: Dynamically Generate MS Word Files.. Robert Julian Browning
- RE: Dynamically Generate MS Word Files.. Billy Cravens
