Hi,
I'm wondering someone might be able to offer a better solution for my situation.
Myself and a client who I'm building an Access database for, use a program called CorelDraw (for graphic design).
The CorelDraw UI can be customised somewhat with VBA (quite handy).
I have created an export feature in both my own and my client's CorelDraw Workspace which exports the current CorelDraw drawing to jpg files placing them into various folders at different resolutions as well as saving an extra copy of the CorelDraw file to 1 or 2 other directories. This is all done using VBA code in a module stored with CorelDraw.
It occurred to me that I could give my client (and myself) the ability to adjust the jpg resolutions and directories where these jpg files export to using a form in our individual Access databases rather than hard coding all this into the module inside CorelDraw.
My current idea is to use various SaveSetting statements in the Access form to store the desired directory paths and jpg resolutions, and then use some GetSetting statements in the CorelDraw module to retrieve this info when the 'Export' button is clicked in CorelDraw. This info would also be stored in a table in the Access database for later reference and modification if the need arose.
I believe I could make this work but I'm wondering if there is a better way? This way seems a little 'clunky' to me.
Particularly given that I would prefer to give the user the ability to create as many exports as they desire and also the ability to alter these at any time which would mean I may end up with redundant registry files building up as the user makes changes over the years. Also I'm not sure how I would loop through registry files to check their existence.
To get around the looping through registry files I thought I'd probably append a sequential number to the 'key' argument in the SaveSetting statement for each jpg export and then create another SaveSetting file indicating how many files to loop through at the Corel end. However this has the potential to leave unused registry files if the user reduces the number of exports. Doesn't feel like a very elegant solution.
As far as the number of registry files being created goes, the VBA function used to export the drawings in Corel (for my purposes) just requires 2 x variable inputs - path of folder and a number indicating the width of the final jpg file in pixels.
The number of jpg exports done will be somewhere around 2 or 3 plus 1 or 2 Corel File saves which only need the folder path variable so the total number of registry files I'd need to create using this method might be in the region of 6 to 9 typically.
Is there any way to retrieve data from a table in a closed database using VBA code written in a module of a different application?
Or can this info be stored in some other type of file which can be read from both programs using VBA?
Or am I being a bit precious and my SaveSetting method is ok?
Thanks for reading.