Please do not post multiple time, so you can edit the same post and update.
You can use OpenDoc6 to open the files OR you can use batch script to open the files without supplying there name. Check an example here: https://forum.solidworks.com/message/507056#comment-507056
Further if you've SOLDIWORKS document manager key, then you can retrieve the properties and filename without even opening the files.
Thank you sir. I am able to open files now.
Another request is that, now opening only part files. I need Assembly and Drawing files as well. I tried using SldWorks.DrawingDoc Object but it did not work. Please suggest what do I need to change.
And how do I get the solid works document manager key ? I don't have information on License as the application was already installed in my VM and work is handover to me.
Thanks for your help.
Here are the changes you need to do
1. Change to DrawingDoc for drawing and AssemblyDoc for assembly.
2. Change to slddrw for drawing and sldasm for assembly.
3. Change to swDocDrawing for drawing and swDocAssembly for assembly.
4. Remove or comment out the line for drawings only.
Picture below shows changes for drawings.
If you want all type in one single macro, then use codes from Zoom and Rebuild macro (by Luke Malpass) in this post: I would like a macro that has 3 steps; Forces Rebuild (ctrl+q) of the current doc, then iso view if its a part or asm, or zoom to fit it its a drawing, then save the doc.