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. Image for the cookie policy date
close icon

Force text formatting on document clone

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 ;) )

1 Reply

AD Administrator Syncfusion Team September 19, 2006 08:46 PM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon