在OpenOffice文本文档中写入TextFrame的问题 [英] Problem with Writing to TextFrame in OpenOffice Text Document

查看:101
本文介绍了在OpenOffice文本文档中写入TextFrame的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在新创建的.odt文本文档上放置了TextFrame控件..
我能够访问TextFrame(控制我在.odt文档中放置的内容),但无法从我的Vb.net代码成功写入它.

这是我的代码段:

Hi,

I placed a TextFrame control on newly created .odt text document..
I''m able to accessing the TextFrame(control what I placed in .odt document) but not succeeding in writing to it from my Vb.net code.

Here is my code snippet:

Dim objDocument As XComponent
objDocument = objDesktop.loadComponentFromURL(PathConverter(FileNameSource), _
                                              "_blank", 0, New PropertyValue(-1) {})

Dim xNamedFrames As XNameAccess = DirectCast(objDocument, XTextFramesSupplier).getTextFrames
Dim textFrames As String() = xNamedFrames.getElementNames()

Dim FrameName As Object = xNamedFrames.getByName("txtFrameEmpID")



我从这里写/插入一些数据库值到此框架中而感到震惊.

任何人都可以帮助解决此问题吗?

[修改:固定的前置标签...您无需将其放置在帖子的整个文本中.另外,为什么不将语言指定为C ++?]



I strucked from here in writing /inserting Some Database value into this Frame.

Could anyone help to resolve this?

[Modified: fixed pre tags...you don''t place them around the entire text of your post. also, why did you assign the language as C++ when it''s not?]

推荐答案

Hi
这可能对您有帮助

Hi
This may help you

Document
-SheetCollection = Document.getSheets()
--Sheet = SheetCollection.getByName( sheetName)
---Cell = Sheet.getCellByPosition( i,j)
----TextCursor = Cell.createTextCursor()
----Cell.insertString(TextCursor)



这是Open Office中用于将数据写入单元格的对象层次结构,请参考Open Office API, http://es.openoffice.org/files/documents/73/1562/OOoBasicTutorial.pdf [



This is the hierarchy of objects in Open Office for writing a data to cell, please refer Open Office API, http://es.openoffice.org/files/documents/73/1562/OOoBasicTutorial.pdf[^]

Thanks & regards
Radhakrishnan G.


这篇关于在OpenOffice文本文档中写入TextFrame的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆