Cindy,
I apologize for not providing more detail up front. The text is coming from
a web application (IE), using the FCKeditor - which provides RTF boxes for
the report's body text to be entered into and formatted (i.e. bold, italics,
underline, bulleted lists, numbered lists, indents, justification, etc.).
The RTF text is stored in Oracle as HTML, but when it comes time for report
generation, the text (RTF) is copied from IE and pasted into MS Word 2003.
The text then needs to re-styled (in MS Word 2003) to meet an internal
Document Service Department's template requirement, which is called "0". It
is similar to "Normal", but has 0 indent, Arial 11pt, and controls the
spacing before and after a paragraph. The reason they created this "Style"
is that it produces the best document in the end when converted to PDF. This
is a defined process, by our Document Service Group, we must submit in Word,
and they convert (and password protect) the documents into PDF.
We can successfully paste the text into Word, from IE, and it has all of its
formatting intact (i.e. bold, italics, underline, bullets, indents,
justification, etc.) - and it will typically paste in as style "Normal" or
"Normal(Web)". When the text is re-styled to "0", we lose bulleting, and in
some cases also the other text formatting (bold, italics, etc.). We have
tried changing the default "paste" option to paste in style=0, but we still
lose bullets, center justification, and indents. We also tried creating a
style "0" in the web-based text editors in hopes that Word would recognize
the style, but we were not successful with that either (it was not recognized
in Word).
Any help you could provide on how to paste in the text, re-style it to "0",
and maintain all formatting (bold, italics, underline, bullet lists, indents,
justification, etc.) would be greatly appreciated.
>Hi Delphis96,
>
[quoted text clipped - 14 lines]
>This reply is posted in the Newsgroup; please post any follow question or
>reply in the newsgroup and not by e-mail :-)
Cindy M. - 19 Oct 2006 14:47 GMT
Hi Delphis96,
> I apologize for not providing more detail up front. The text is coming from
> a web application (IE), using the FCKeditor - which provides RTF boxes for
[quoted text clipped - 25 lines]
> and maintain all formatting (bold, italics, underline, bullet lists, indents,
> justification, etc.) would be greatly appreciated.
Basically, you can't do it this simply. In a Word document, styles are the
basis of formatting at the paragraph and the character level. Applying one
style over other formatting will dump the other formatting, the only exception
is that character formatting will be retained under certain circumstances (how
large a percentage of the text has the different formatting).
As soon as you apply style "0", all paragraph-level formatting (which includes
bullets, indents and justification) will be lost. That's just how Word is
designed to work.
As possible solutions, I can imagine
1. Loop through all the paragraphs in the document, note the special formatting
for each paragraph, apply the style, then loop through again and reapply the
special formatting
2. Transform the RTF (or HTML) to WordProcessingML. You should be able to do
this, including the style tag for the paragraphs and retaining the special
formatting.
Neither approach will be "trivial", but both should be doable. I'd lean towards
(2), as retaining the character formatting should be simpler/more efficient. If
all this is just for generating PDFs (no other purpose), it would probably be
worth looking at transforming directly in the XML format for PDF...
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
delphis96 - 19 Oct 2006 16:07 GMT
Cindy,
Thank you so much for the feedback. I certainly don't expect the answer to
be 'easy'... I honestly just need one that works (haha). We will be trying
several different concepts, and your number two is certainly up on the list
of fixes to apply. I'll let you know how it goes.
As far as it ultimately becoming a PDF, there is a process requirement that
we generate a Word document to be submitted. I think if we could submit a
PDF, there would most likely be a much less complex solution. We have
inquired about the ability to generate and submit PDF's directly, and have
not received positive response. Maybe that will change in the future. For
now, we are trying several different options to solve our current 'dilema'.
Again, thank you very much for your suggestions.
Kindest Regards,
John
>Hi Delphis96,
>
[quoted text clipped - 36 lines]
>This reply is posted in the Newsgroup; please post any follow question or reply
>in the newsgroup and not by e-mail :-)