1

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.

Todd Main
  • 28,951
  • 11
  • 82
  • 146
Anders Lindahl
  • 41,582
  • 9
  • 89
  • 93
  • This is a comment because it doesn't directly answer you question. But if you open the VBE (Visual Basic Editor) and press F2 it will open the Object Explorer. Searching on the constant in question will at allow you to see it's numerical value. Not perfect, but a functional workaround. – Oorang Nov 17 '09 at 17:35

2 Answers2

2

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.

Ed Schembor
  • 8,090
  • 8
  • 31
  • 37
  • Thanks for your answer, Ed! That's the best lead so far, and I'll consider accepting it. But I would prefer a solution that is runnable without installing any extra dlls. I have edited the question to reflect that. – Anders Lindahl Feb 08 '10 at 08:49
1

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.

Todd Main
  • 28,951
  • 11
  • 82
  • 146
  • Thanks, but that just moves the problem from "keeping my own list of values" to "keeping someone elses list values up to date". I would prefer a solution where I ask the currently running Office installation what it's value for msoTrue is. – Anders Lindahl Feb 11 '10 at 09:54
  • 1
    You're up against the same issue faced by other scripts as well, such as VBScript. There is no way, other than using a Type Library DLL query, for LotusScript to be able to query the constants from the host program. The constants were built for the language (VBA, VSTO, etc.), not for the program. You've got two choices here: 1) use a Type Library or 2) maintain a list of constants in your code. – Todd Main Feb 13 '10 at 20:10