We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Force text formatting on document clone

Thread ID:

Created:

Updated:

Platform:

Replies:

49442 Sep 19,2006 04:16 AM Sep 19,2006 04:46 PM Windows Forms 1
loading
Tags: DocIO
Richard Bacon
Asked On September 19, 2006 04:16 AM

Using the sub: -

-=-=-=-=-

Sub renderitem(ByVal doc As IWordDocument, ByVal sData As String, ByVal iSection As Integer, ByVal bBreak As Boolean)
Dim HTMLdocument As WordDocument = New WordDocument()
Dim convertor As HTMLToDLS = New HTMLToDLS()
convertor.Convert(HTMLdocument, sData)
If bBreak Then
HTMLdocument.Sections(0).BreakCode = SectionBreakCode.NewPage
End If
'' Create MemoryStream for storing the document.
Dim mem As MemoryStream = New MemoryStream()
'' Save document to stream.
HTMLdocument.Save(mem, FormatType.Doc)
'' Sets the position to the Stream.
mem.Seek(0, SeekOrigin.Begin)
'' get pos of background for proposal
Dim bgsection As IWSection = doc.Sections(iSection)
Dim secs As IWSectionCollection = HTMLdocument.Sections
For Each sec As IWSection In secs
'' Enumerating all the paragraphs in the current section.
Dim paragraphs As IWParagraphCollection = sec.Paragraphs
'' Cloning all the paragraphs from current section and merge it into the new document.
For Each paragraph As IWParagraph In paragraphs
bgsection.Paragraphs.Add(paragraph.Clone(doc))
''What?.CharacterFormat.fontname() = "Verdanna"
''What?.CharacterFormat.fontsize = 10
Next paragraph
Next sec
End Sub

-=-=-=-=-=-=-=

It it possible to force the output to be verdanna 10pt? (where I have "what?" remmed out)

Thanks in advance. If this can be sorted, then I think this product will do everything we need (until further notice ;) )

Administrator [Syncfusion]
Replied On September 19, 2006 04:46 PM

Hi Richard,

Thank you for your interest in Essential DocIO.

Yes, it is possible to force the document paragraphs output to the particular paragraph style like setting the font name as verdana, size as 10pt, etc. I have created a small sample to illustrate this functionality. Please take a look at the attached sample and let me know if it meets your need.

Thanks,
Prabhu

HTMLToDoc.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;