The code

Selection.InsertBreak Type:=wdPageBreak

Is not a property setting but a method call.  The equivalent code in
CFScript would be

wordDoc.Selection.InsertBreak(7);

I'm not sure why the convention in VB is to use named parameters here since
there is only one parameter.

That said, Ian is 100% correct that you should never use Word automation in
any server side language--CF, ASP, JSP, whatever.  Word is not safe for
unattended execution and there are other ways to achieve the same result
about a million times faster.

Here are a few presentations I've given on the subject:

Serving Word
http://www.rewindlife.com/archives/000032.cfm
  
Integrating ColdFusion with Microsoft Office: Breezo and examples  
http://www.rewindlife.com/archives/000118.cfm

And a blog entry exactly on point...

Forced page breaks in Word documents and standard HTML pages  
http://www.rewindlife.com/archives/000096.cfm

HTH,

Sam

-----------------------------------------------
Blog: http://www.rewindlife.com
Charts: http://www.blinex.com/products/charting
-----------------------------------------------

> -----Original Message-----
> From: Ian Skinner [mailto:[EMAIL PROTECTED]
> Sent: Monday, January 26, 2004 4:22 PM
> To: CF-Talk
> Subject: RE: Word Object
>
> Other then the generally bad mojo of using a word come object
> on a web-site/server (even Microsoft says this is a bad and
> unsupported idea).  When I was trying to do it last year, I
> found CF had a very hard time nesting object layers.  An
> object variable could only access it's immediate methods and
> properties, not the methods and properties of it's children.  
> I need to create another variable to hold each child
> object/collection I wanted to work on.
>
>
> I also had a lot of trouble using word com constants such as
> wdPageBreak.  I had to find a resource (or use trial and
> error) to get the actual integer value associated with the constant.
>
>
> The first thing I would try is Selection.InsertBreak.Type = 1
> <!---- or whatever value wdPageBreak stands for --->
>
>
> Then you might need to try something like
>
>
> SubSection = Selection.InsertBreak
> SubSection.type = 1 or wdPageBreak
>
> Hope that helps, I know after fighting for some two or three
> months to get a Word Com solution to work, we ended up doing
> a much simpler Rich Text (RFT) solution where we just had to
> create RFT markup in a string variable then save it as a file
> with an RFT extension.  Worked very well and we could do all
> the formatting we needed to at the time.
>
> --------------
> Ian Skinner
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to