VBA - 使用 getColumnNames 方法从 Lotus Notes 数据库中获取列名称
因此,我在 Lotus Domino 数据库中有一个视图(对象名称为“view”),我想从中获取列名称并将它们放入数组中:
Dim view As Domino.NotesView
Set view = db.GetView(viewScen)
//viewScen is a string containing the actual view's name
//db is a string containing the actual db name
这些声明工作正常,但是当我尝试将这些值分配给数组时使用名为“getColumnNames”的方法,VBA 编辑器告诉我该对象不支持该方法:
Dim someArray() As String
//I tried both of the following with no sucess...
someArray = view.getColumnNames
someArray() = view.getColumnNames
我做错了什么?
So I have a view (object name is 'view') in a Lotus Domino db from which I want to grab the column names and put them in an array:
Dim view As Domino.NotesView
Set view = db.GetView(viewScen)
//viewScen is a string containing the actual view's name
//db is a string containing the actual db name
These declarations work fine, but when I try to assign those values to an array using the method called 'getColumnNames', the VBA editor tells me that the method is not supported for that object:
Dim someArray() As String
//I tried both of the following with no sucess...
someArray = view.getColumnNames
someArray() = view.getColumnNames
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为你可以用列来做一个 For..Each
I think you can do a For..Each with columns
根据8.0帮助文件,COM/OLE不支持getColumnNames方法。但是,支持 ColumnNames 属性。这是帮助文件中的 VB 代码:
According to the 8.0 help files, the getColumnNames method is not supported in COM/OLE. However, the attribute ColumnNames is supported. This is VB code from the Help file: