如何替换 OpenOffice 文档窗口/Win32 的内容 记录的解决方案不起作用?
我正在使用 OO 3.0 并根据官方 openoffice 文档 (http://wiki. services.openoffice.org/wiki/Documentation/BASIC_Guide/StarDesktop)为了替换文档,这是所需的代码:
Dim Doc As Object
Dim Dummy()
Dim Url As String
Dim SearchFlags As Long
SearchFlags = com.sun.star.frame.FrameSearchFlag.CREATE + _
com.sun.star.frame.FrameSearchFlag.ALL
Url = "file:///C:/test.odt"
Doc = StarDesktop.loadComponentFromURL(Url, "MyFrame", SearchFlags, Dummy)
MsgBox "Press OK to display the second document."
Url = "file:///C:/test2.odt"
Doc = StarDesktop.loadComponentFromURL(Url, "MyFrame", SearchFlags, Dummy)
我尝试过,但它不起作用,从 VB 和 OO Basic 都尝试过 我缺少什么? (我使用所有标志 23+8 甚至 55 作为搜索标志掩码)
I am using OO 3.0 and according to the official openoffice documentation (http://wiki.services.openoffice.org/wiki/Documentation/BASIC_Guide/StarDesktop) in order to replace the document this is the code required:
Dim Doc As Object
Dim Dummy()
Dim Url As String
Dim SearchFlags As Long
SearchFlags = com.sun.star.frame.FrameSearchFlag.CREATE + _
com.sun.star.frame.FrameSearchFlag.ALL
Url = "file:///C:/test.odt"
Doc = StarDesktop.loadComponentFromURL(Url, "MyFrame", SearchFlags, Dummy)
MsgBox "Press OK to display the second document."
Url = "file:///C:/test2.odt"
Doc = StarDesktop.loadComponentFromURL(Url, "MyFrame", SearchFlags, Dummy)
I tried it and it is not working, tried both from VB and OO Basic
what am I missing ?
(I used all flags 23+8 and even 55 as the search flags mask)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
阅读更多示例脚本后,我尝试手动设置名气名称:
虽然使用 loadComponentFromURL 似乎不会更改框架名称,但使用 setName 确实会更改框架名称,因此在第一次调用 loadComponentFromURL 之后,我使用 setName 更改了框架,从现在开始它按预期工作
After reading more example scripts I tried setting the fame name manually:
While using loadComponentFromURL seems not to change the frame name, using the setName does change the frame name so after the first call to loadComponentFromURL I changed the frame using setName, and from now on it si working as expected