PDA

View Full Version : Is it possible to use Equation feature through VBA



john909228
05-16-2010, 04:03 PM
Is it possible to use the Equation feature through VBA? I was planing on using word because word has an Equation feature but if this is possible through powerpoint that would even be better.

I will do my best to explain what I would like to do. If it is unclear, I apologize in advance, please let me know and I will try to be more clear.

As an example:

I would like to have 5 input boxes so that a user can enter numbers. Once the user is complete they can press a button and the numbers will be displayed in a "professional" equation as a "stacked Fraction" layout.

( I tried to provide an image but since I am new the system will no allow an active link here is the address to a link that might help explain a little better at http: you will need to remove these words //i286.photobucket.com/albums/ll100/jamescrglst/Equationform-2.jpg)


any suggestions would be appreciated.

Thank you in advance for your time.

TonyJollans
05-17-2010, 01:09 AM
What version of Word?

john909228
05-17-2010, 08:14 AM
Sorry for not including that important bit of information. I am currently using Word 2007.

Thanks again for any help you may be able to provide

TonyJollans
05-18-2010, 02:25 AM
The answer is, I believe, Yes, you can do it - but it isn't easy! Don't think I am ignoring the question - I am looking at it and will report back as soon as I can.

TonyJollans
05-19-2010, 10:10 AM
I have spent some interesting time playing with equations, only to find out that what you want to do is straightforward :)

Set R = ActiveDocument.Content
R.InsertParagraphAfter
R.Collapse wdCollapseEnd
R.InsertAfter "(" & a & "+" & b & ")/(" & c & "*" & d & ") = " & e
Set R = R.OMaths.Add(R)
R.OMaths(1).BuildUp

john909228
05-23-2010, 11:13 AM
just had a chance to try your suggestion and it seems to work great.

Thanks for your time and effort