|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
ColdFusion 8 & COM objects
Author: Stone, Lori
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:56401#305349
Has anyone connect to a word document via COM with CF 8 yet? If so, did
you have any problems with it? I am trying to connect and it WILL NOT
work. It is driving me nuts because I do not see any reason why it
should not. Just doing a simple connect/open file just hangs or I get
an error message saying that the range method was not found. I need to
know if it is my installation or cf 8 or neither. I am also using MS
Office 2007. If anyone has experience with this please let me know.
---OR---
Can someone try and run this code on CF 8 Dev with MS Office 2007 and
let me know if it works. That is what I am using. So, if someone else
can get it to run fine then it may be my installation of CF or
something. Just trying to narrow down where the issue is because I know
it is not with the code. The file I am using is being saved as a 97-03
word doc.
<cfscript>
objWord=CreateObject("COM", "Word.Application");
objDoc = objWord.Documents;
wordDoc = objDoc.Open(ExpandPath( "new.doc" ));
docRange = wordDoc.Range(0);
docText = docRange.Text;
</cfscript>
<cfdump var="#wordDoc#">
<cfscript>
wordDoc.Close();
objWord.Quit();
</cfscript>
Thanks!
Lori
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||