avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday January 26, 2021, 6:53 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: an ole component for calculation?  (Read 4112 times)


  • Participant
  • Joined in 2005
  • *
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
an ole component for calculation?
« on: September 07, 2008, 12:08 AM »
During my work, I often write documnets in ms-word. But the doc has many numbers in it, which need to be calculated via a some complex function and to be modified frequently.

Is there a method to write an ole control, so that
1. when I choose menu 'insert->object' in ms-word, a window is popped up, then I can type in the calculation steps in some program language

2.when I close the 'fake ms-word add-in for calculation' window, the result (here, it is 8) is shown in the doc

3.when I double-click the result 8, I can view/edit the code again like what I do in step 1

4.the prg is stored in DOC file too

mathtype equation ( ) is such kind of thing, but only for displaying nice equation

I don't think vba is a good answer, the main reason is: the vba code has an incompact link with its result in the documnet. If there are many calculation, I have to remember which function yields which result, when I have to modify, I must browse all VBA function name

for the calculation part, I prefer to python( interpreted langauge for the following reasons:
1.the pythonxx.dll supplies many math operations and functions(+-*/, sin/cos/..., log, pi, pow etc), which is only about 1.7M
2.if more math function is need, scipy+numpy can be used, however ~23M space will be used; or we can use  which is smaller but with limited function

I can write program in FB, python and a little C. Can any one tell me this kind of software possible
2.which technology is used? if there are some simple code demo, it will be better.



  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 84
    • View Profile
    • Donate to Member
Re: an ole component for calculation?
« Reply #1 on: September 07, 2008, 04:09 PM »
Something like AutoIt or AutoHotKey should be able to handle that. They have eval() and execute() functions that can perform the calculations and good clipboard functionality that will let you retrieve the expression to be calculated and paste the result back into the application (MS Word, e.g.).


  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: an ole component for calculation?
« Reply #2 on: September 07, 2008, 06:38 PM »
I'm not saying autohotkey is a good solution, I'd just like to point out that AHK doesn't have a "pure" eval funcion, if autoit does, then it probably is a better option.


  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,776
    • View Profile
    • Donate to Member
Re: an ole component for calculation?
« Reply #3 on: September 07, 2008, 06:59 PM »
why not just insert a spreadsheet??

you only need to show a few cells, and you have the power of excel at you're disposal