Open ghost opened 5 years ago
There used to be some autosave functionality. It was notoriously good at stealing focus and saving exactly when you didn't really want it to save. I assume it's similar with this suggestion.
An alternative might be to "automatically export on save" as an opt-in setting. Thoughts?
I'm just expressing a wish to save snapshots of the code independently from the template because you can't save versions of the code from within the VBA IDE or from within Word itself. If stealing of the focus was an issue in the past then I'd be happy for Rubberduck to save just the module that the focus is leaving at any change of focus. Syncthing or some other versioning package will take care of any subsequent 'filing issues'.
How about having a hotkey for export project?
That said the focus issue with the defunct autosave feature was because we were saving the host document - exporting code files might be less disruptive.
Just brainstorming here, but it might be possible to minimize disruption if we leverage the parser's cache to only export files that have changed since the last export.
Not really a contribution other than an expression of frustration which supports my request above. Does anyone else experience Word crashing on what seems like a routine basis when just editing VBA code. I've just lost another hours+ worth of work due to this issue. It seems to happen to me at least once a day (and office gets at least a weekly full installation). Yes I could save the template every 2 minutes but when you are deep in though resolving issues you don't always remember to do this. I'm strongly tempted to move my (personal) project to c# and Visual Studio (mutter mutter mutter whinge whinge whinge)
I have a related question: I don't need autosave exactly, it is enough for me to export the code on each save / compile / close and I can use the VBA itself for this. The problem child for me is Outlook, where the code isn't exposed natively. The only way from there I have found is using olevba and parse the result, and this is the way I am using currently...
Is there a way to trigger the export function from inside of Outlook VBA?
@majkaz I'm not sure that I understand what you mean by "the code isn't exposed natively". Do you mean that the VBProject isn't available via the Outlook object model, or something else? If that's the case you should be able to simply reference the VB extensibility objects and use those (if you're willing to deal with the security implications of doing that).
Yes, VBProject isn't available via the Outlook object model. When I was searching for a solution, I have just found (maybe false) information that there is no possibility to export the code from Outlook. I have currently a working way to get this using olevba, I am just looking for a solution that doesn't need the extra tools (and Python). Edit: It is not possible to get the reference from VB extensibility objects either...
If there are no immediate plans to reintroduce version control to RubberDuck would it be possible to introduce exporting the project file every X minutes.