Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
natebaca #1
COM Objects
I am using COM to call Microsoft Word in order to create a text document. I
would like to save the document as an .ini file. The only problem is that
every time I save it, all of the other info from the .doc file is being
included in my .ini file. I'm using the code from Ben Forta's book "Advanced
Macromedia CFMX App Development."
<CF_UseComObject Class="Word.Application"
SharedName="APPLICATION.ComObjects.MSWord" LocalName="objWord">
<cfset objWord.Visible=False>
</CF_UseComObject>
<cfset objDocuments=objWord.Documents>
<cfset newDoc=objDocuments.Add()>
<cfset docRange=newDoc.Range(0)>
<cfset docRange.Text="Hello World!">
<cfset DocFilePath=ExpandPath("HelloWorld.ini")>
<cfset newDoc.SaveAs(DocFilePath)>
<cfset newDoc.Close()>
Any help on how to save it as an .ini file would be greatly appreciated.
Thanks.
natebaca Guest
-
Updating Objects in Objects in the Library
We just received an InDesign job from a client and they provided templates, fonts, art, and a library. When I drag a library item onto a page I get a... -
Newbie Question? Aligning Objects to other Objects?
Hi, I think this a newbie question and I will try to explain it as best as possible! I have a hollow circle (no fill, or stroke) and x amount of... -
Storing Objects/Arrays in Stored Objects
Hello All, I recently came across a very frustrating issue when trying to create and store arrays within objects in a Shared object. It took me... -
Accessing objects of other objects?
Hi, I have the following problem: On page "A" of my homepage I create an object "1" which itself creates an object "2". Now how can I access... -
is this an acceptable way of passing objects to other objects?
I've read that objects should always be passed by reference to other objects. I've also read that future versions of PHP may not support runtime... -
natebaca #2
Re: COM Objects
I found a way to do this earlier today.
Change the line
<cfset newDoc.SaveAs(DocFilePath)>
to
<cfset newDoc.SaveAs(DocFilePath, val(2))>
natebaca Guest
-
MrBoston #3
Re: COM Objects
Why would you be going through the hassle and risk to use word to create an
..ini file? Why not just write to a new file?
<cffile action="write" addnewline="yes" file="Test.ini" output="[portal]
Param1=2
Param2='Red'" fixnewline="no">
??
Chris
MrBoston Guest



Reply With Quote

