How to set up classes in Word VB
Afternoon all!
After reading through the "Automation Overview" in the MathCAD Developer's Reference, I came across this statement:
"There are two top level objects which you can create by asking the system for a new instance of them. The Application class can be invoked by co-creating an instance of Mathcad.Application. Additionally, the Worksheet class can be invoked directly by co-creating an instance of Mathcad.Worksheet. Other objects can only be manipulated through these objects and their children: the Worksheet.Regions collection, for example, cannot be created on its own."
I have been able to figure out how in Word VBA to create the top level object "Application Class" through the following code:
Dim MathCAD As Object
Set MathCAD = CreateObject("Mathcad.Application")
I also tried the same thing for the "Worksheet Class", but Im not sure if it actually works yet since I am unable to get any of the Worksheet Properties, Methods, or Events in my code to work:
Dim Worksheet As Object
Set Worksheet = CreateObject("Mathcad.Worksheet")
Could someone PLEASE reply with an VB EXAMPLE of how to define (in VB for Word) ALL 10 CLASSES? I would like to be able to see from this example:
- how other classes (objects Im guessing in Word) are created through the two top level classes
- 1 example of EACH CLASSES' Properties, Methods, or Events
Here are the list of available classes: (from MathCAD "Developers Reference")
- Application Class
- Worksheet Collection (items are Worksheet Objects)
- Worksheet Class
- Worksheet2 Class
- Window Class
- Region Class
- Region2 Class
- NumericValue Class
- StringValue Class
- MatrixValue Class
Thanks to whoever can help me out with this! I would be forever in your debt!!!!
(One more thing: please don't just point me over to the "Developer's Reference" (I put that in quotes for a REASON!!, lol). I have read through that thing a bunch over the last few weeks and it doesnt help out ONE BIT for showing information on how to set up a Property, Method, or Event for a class, especially for things like the Options Property, the Regions Property, and how to define the MCWorksheetOption criteria under the SetOption Method. It is VERY vague for me, since I'm not classically trained as a programmer!)

