OpenNTF.org - Microsoft Office Constants Scr
My Links (Not logged in)
Code Bin Search
 
Hosted by Prominic.NET
Rate This Code
5 - brilliant stuff
4 - very nice
3 - average
2 - needs work
1 - bad
   OpenNTF Code Bin
About This Code
Brief Description:
Microsoft Office Constants Script Libraries 
Rating:
Not Rated Yet 
Contributor:
Kevin Pettitt 
Category:
Lotusscript 
Type:
OLE/ActiveX 
Document Release:
1.0 
Notes Version:
R6.x, R8.x, R7.x 
Last Modified:
02 Apr 2009 
OpenNTF Disclaimer

All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.

Code / Description
Using the OpenNTF Project "Microsoft Constants Database" (available here: http://www.openntf.org/Projects/pmt.nsf/0/1F6C5C7B16317E218625726D004A31A9), i have extracted all the constants for Excel and Word into Script Libraries. A little cleanup was necessary since Lotusscript didn't like some of the constant names and a few other issues. Search for ' character to find constants that were commented out.
Usage / Example
I've actually embedded the libraries, along with some additional views I created to help produce them, into the above-mentioned Microsoft Constants Database. If you want to take those views and product libraries for the other MS products, you might want to fiddle with the selection formulas to focus, for instance, on a specific application version (i.e. Excel 2000 as opposed to all versions).


You'll see that to avoid duplicate constant names (used across multiple app versions) I have categorized the first column in the custom views to show "Const xlwhatever = 3" etc. Just select all the *categories* in the view (not the documents themselves), do an "Edit - Copy Selected as Table", paste into excel, remove the blank first column, and paste what's left into Notepad. Then Copy that into a script library. Then cleanup whatever won't compile. Kludgey, but works.

Code Attachments
 Comments
Posted by Eric H Romo on 04/06/2009 11:34:12 AMAlternate way to parse input: Split function
Instead of this:
Line Input #intFileNum, strRecord
intEqualSymbol = Instr(1, strRecord, "=")
Set doc = New NotesDocument(db)
doc.Form = "frmConstant"
doc.conApplication = strApplicationName
doc.conConstant = Trim(Left$(strRecord,intEqualSymbol - 1))
doc.conValue = Trim(Right$(strRecord, Len(strRecord) - intEqualSymbol))
try this:
Line Input #intFileNum, strRecord
arrRecord = Split(strRecord, "=")
Set doc = New NotesDocument(db)
doc.Form = "frmConstant"
doc.conApplication = strApplicationName
doc.conConstant = arrRecord(0)
doc.conValue = arrRecord(1)
 Add your comment!