Professional Web Applications Themes

Writing Word with CFContent - Coldfusion - Advanced Techniques

I can write a simple word doent using cfcontent. However, I do not seem to be able to impose any formatting on it. Does anyone out there have any experience with this?...

  1. #1

    Default Writing Word with CFContent

    I can write a simple word doent using cfcontent. However, I do not seem to be able to impose any formatting on it. Does anyone out there have any experience with this?
    stephenhardesty Guest

  2. #2

    Default Writing Word with CFContent

    I can write a simple word doent using cfcontent. However, I do not seem to be able to impose any formatting on it. Does anyone out there have any experience with this?
    stephenhardesty Guest

  3. #3

    Default Re: Writing Word with CFContent

    One technique is to create a template in word embed your vars #myvar# etc then save to RTF format.

    Then open up the template and add it with your necessary CF logic and serve under cfcontent
    Pete Thomas Guest

  4. #4

    Default Re: Writing Word with CFContent

    Try creating the doent in Word, formatting it how you want, then save it as
    HTML. Open the HTML file in dreamweaver and inspect the formatting styles. You
    should be able to implement the same style attributes in you doent to
    reproduce the formatting.

    kyle969 Guest

  5. #5

    Default Re: Writing Word with CFContent

    BTW, this also works well with Excel.
    kyle969 Guest

  6. #6

    Default Re: Writing Word with CFContent

    Okely dokely....
    I have a question,

    How do you go about assigning the relevant styles to the relevant text?
    I assume I use the RANGE from the word object model, but i am having some real
    difficulty in redifining the new rane to attribute the new formatting to.

    I currently have
    cfset objdoents = objword.Doents>
    <cfset newdoc = objdoents.add()>
    <cfset docrange = newdoc.range(0)>
    <cfset docrange.font.bold = true>
    <cfset docrange.text = "Hello this is a test">
    <cfset docfilepath = expandpath("hellowayne.doc")>
    <cfset newdoc.saveas(docfilepath)>
    <cfset newdoc.close()>

    this works great and Bolds the whole new text.
    how do I now add further text? and apply a different formatting to the new
    text?

    HeloWorld Guest

Similar Threads

  1. cfchart image not exporting to Word when using cfcontent
    By bill_doe in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: July 14th, 05:33 PM
  2. Writing a pdf from word using acrobat 4 vs 6 - Missing Graphics
    By s_raynes@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 1
    Last Post: May 11th, 04:43 AM
  3. Replies: 1
    Last Post: July 8th, 08:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139