[V8i VBA] Adapting a Simple VBA to Work in PW

I have a need for a macro to run in both a managed and unmanaged workspace for multiple datasources. While it will be needed for every active project on our system, it will only need to be run once on one particular  file that exists in every project. I have a means to run it if our system detects the user has opened the file, and it will be able to test to see if that file has already has been modified by the macro should a user open the file again, so it can only make its modification one time. Eventually, we will turn off the macro so it does not slow things down.

My VBA and ProjectWise code guru is currently unavailable, so I am forced to try and use the KISS principle and since this is a specialty macro, I don't want to spend a lot of time trying to make this thing elegant - I just need it to work.

The one variable in this whole process, is accessing a particular file in a particular folder. The file is one of our seed files, so its name is a constant (pun intended). The file is in one of the folders pointed to by MS_SEED.

While working out all the other details, I used the local working directory information to access the file. This was OK while I worked out all the other details but for implementation, I don't want to have to use the same cludge, unless I have to. This gets particularly sketchy when it comes to the unmanaged workspace, since the seed file paths will vary for every consultant.

So , my seed file is named "SHA_Border.dgn" and it is stored in one of the folders as defined in MS_SEED. I am using OpenDesignFileForProgram to access the file, What kind of code would allow me to search MS_SEED for that file and retrieve the full path filename to be passed to OpenDesignFileForProgram?

Remember, this needs to find the file inside or outside of ProjectWise.

TIA

Parents Reply Children
No Data