I'm curious, why are you going about it this way?
If you're loading a file you would read the values from the file, not the corresponding card.
What are you trying to achieve? It sounds like you may not need a template at all.
You're correct, Lee. I don't need to read the values from the card, but I do need to write values to it once I've read the corresponding file, so I will need to access the value of an editbox for the purpose of setting it.
My best guess at accessing the values (reading or writing) on a template card is to use poCmd.mpoExtra to get a reference to the EnumeratorVariable object. This seems obsure, because variables are typically read from a file, and in the case of a template the file doesn't exist yet. It's the only possible solution I can see, though.
Sadly, I can't test my theory because (again) EPDM patently refuses to allow me to debug my code. I can't even install the addin in debug mode.
There are many posts from others on this forum about the stupid problems that occur when trying to do this and the insane workarounds that people are having to use. None of them are working for me, so I'm forced to abandon this project entirely.
It is nothing short of shameful for SolidWorks to charge thousands of dollars for a product then leave these sort of egregious bugs unaddressed for years.
Your are correct that you will use the IEdmEnumeratorVariable5 object returned from the Card Button. Once you have it you can use the GetVar and SetVar methods.
While many times variables are read from files they can also come from folders and items (if you use those). In fact, IEdmEnumeratorVariable6 has a GetVarFromDb method that reads directly from the database and not the file.