Dim Font As JavaObject
Font.InitializeNewInstance("com.itseasy.rtf.text.Font",Array("FAMILY_ROMAN","TIMES_NEW_ROMAN"))
Dim TextPart As JavaObject
TextPart.InitializeNewInstance("com.itseasy.rtf.text.TextPart",Array("Your centerd text" ))
Dim Paragraph As JavaObject
Paragraph.InitializeNewInstance("com.itseasy.rtf.text.Paragraph",Array(28, 0, 34,Font.GetField("TIMES_NEW_ROMAN"),TextPart))
Paragraph.RunMethod("setAlignment",Array(Paragraph.GetField("ALIGN_CENTER")))
Dim PageSize As JavaObject
PageSize.InitializeStatic("com.itseasy.rtf.text.PageSize")
Dim doc As JavaObject
doc.InitializeNewInstance("com.itseasy.rtf.RTFDocument",Array(PageSize.GetField("DIN_A4_QUER")))
doc.RunMethod("setViewscale",Array(doc.GetField("VIEWSCALE_FULLPAGE")))
doc.RunMethod("addParagraph",Array(Paragraph))
'
Dim jFile As JavaObject
jFile.InitializeNewInstance("java.io.File",Array(File.Combine(File.DirRootExternal,"myfile.doc")))
doc.RunMethod("save",Array(jFile))
Paragraph.RunMethod("addText",Array(TextPart))
doc.RunMethod("getDocument",Null)