Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to port to a MS Word plugin? #70

Open
MGG1996 opened this issue Sep 24, 2024 · 4 comments
Open

Is it possible to port to a MS Word plugin? #70

MGG1996 opened this issue Sep 24, 2024 · 4 comments

Comments

@MGG1996
Copy link

MGG1996 commented Sep 24, 2024

Greetings Jonathan, thank you for your wonderful plugin, it works fine and helps me to typeset beautiful equations elegently.

The excellence of this plugin makes me strart wondering if the same thing could be achieved in MS Word, so is there any possibility of porting this plugin to MS Word, or do you have any plans to develp a new plugin for MS Word.

I hope this message wouldn't disturb you. Wishing you all the best.

@MGG1996 MGG1996 changed the title Is it possible to port to a word plugin? Is it possible to port to a MS Word plugin? Sep 24, 2024
@Jonathan-LeRoux
Copy link
Owner

I have thought about it, and I believe I even briefly looked at it several years ago but quickly ran into issues and gave up. It must be feasible to adapt quite a few features (while many other PowerPoint-specific ones will become irrelevant), but I just don't know Word and its VBA object model well enough to feel comfortable taking this upon me.
I'd be happy to help someone willing to do it though.

@MGG1996
Copy link
Author

MGG1996 commented Sep 24, 2024

Thank you for your immediate response!

It turns out that migrating to MS Word is not an easy task. Thanks again for your patience.

For a Word plugin design noob, like me, what information do I need to know, what development tools do I should to use, and what programming languages do I need to master?

@Jonathan-LeRoux
Copy link
Owner

You don't need much, as the VBA editor is built into Office applications. Just use Alt+F11 to open it.

Then you need to code in VBA. It's not the best programming language, to be honest. I would start by looking at the IguanaTex code and trying to understand how things work (that's how I learned...). You could also use the Debugger to go through typical action calls and see what happens. Open the .pptm of IguanaTex, open the VBA editor, search for "Macros" under "Module" in the exploration pane, and put a breakpoint at Line 7 Load LatexForm under NewLatexEquation(). Then click on the button in the IguanaTex Ribbon to create a New Display, and it should take you to that line and stop there. You can now "Step over" (Shift+F8) or "Step Into" (F8) the various steps to see what's going on.

To modify the add-in for Word, my strategy would be to heavily use ChatGPT or MS Copilot, asking them how to convert the parts of IguanaTex that are PowerPoint-specific to Word-specific equivalents. I just tried to do that with the first few lines of NewLatexEquation(), which involve a Slide object, and honestly it seems to give pretty useful answers:

Adapting a PowerPoint VBA add-in to Word involves replacing PowerPoint-specific objects and methods with their Word equivalents. In PowerPoint, Slide objects and selections are commonly used, but in Word, you'll work with Document, Selection, and Range objects.
Here's how you can adapt the given code snippet to work in Word: ...

@MGG1996
Copy link
Author

MGG1996 commented Sep 25, 2024

Thanks a lot for your kind assistance. Best wishes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants