Open Thylowz opened 3 years ago
I think you can only replace a .csv by a .csv. So embed a dummy .csv instead of your .xlsm in your template.
As you can see in the archive I attached, it's what I tried to do in the template. I put a dummy.csv, which Word translates into the .xlsm, which explain why I set up replace_zipname the way I did.
I did that because I thought that the behaviour would be the same as the one with excel file. Should I proceed differently?
I do not know why MSWord transformed the .csv into a .xlsm, but I guess it is waiting now a .xlsm and not a .csv I am afraid there is no solution for that. May be you could try to put your .csv into a .zip and use a dummy .zip in template.
Sadly I do not have that much "flexibility". Do dummy.zip work though? I thought it didn't due to the way OLE object are handled by MSWord?
I'll probably try by converting csv to xlsx and put dummy xlsx.
In the same way as described for xlsx file, I tried to reproduce the xlsx example with CSV (since it is not an OLE object, it should work in my mind).
Sadly, I can't get it to work. Maybe I'm missing something but it seems OK to me.
csv_replacement_test.zip