English 中文(简体)
How to import Microsoft Office constants (msoTrue, ppLayoutText...) into LotusScript?
原标题:

I am trying to programmatically make a PowerPoint presentation from the contents of a Lotus Notes document. This is relatively straight-forward using CreateObject("Powerpoint.Application") but I fail to find a way to access the various constants that are used in VBA.

One solution is of course to hard-code the (ten or so) values into my script, but for obvious reasons I m a bit uneasy about that solution.

Is there a way to lookup the value of for example msoTrue or ppLayoutText with LotusScript? For example a way to query the Powerpoint.Application object for the values?

(In more compentet languages adding various Interop libraries seems to do the trick, but I haven t found a way to do that in LotusScript.)

Edit I prefer a solution that will work without any extra installation of software or dlls, apart from Office.

最佳回答

This is what I use for MS Office constants: Microsoft Constants Database. There is a script library that has recently been added for Word and Excel.

问题回答

You can have your code lookup these MS constants by creating an OLE object of type "TLI.TLIApplication" object (defined in tlbinf32.dll), and then querying that object for all of the office VBA constants. There is an MSDN article describing this technique in general here: http://msdn.microsoft.com/en-us/magazine/bb985086.aspx

There is also sample code for exactly this procedure in a LotusScript environment here: http://noteslog.com/post/ole-constants/

Note that this is a runtime-only technique. This inspection method will make all of the constants available to your code, but will not make the constants available through Intellisense in the Domino script editor.





相关问题
Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

Outlook 2007 CommandBarControl.Execute won t work

I recently switched to Outlook 2007 and noticed that my VBA-macros won t work. I use the following code to open a new appointment-item (and fill it automatically). It worked perfect in Outlook 2003, ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

MS Access: list macro from VBA

I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...

热门标签