Thank you for your reply.
I did add the indesign reference and it still gives the error.
for ("InDesign.Application") it say simple not supported
and for ("InDesign.Application.CC or .CC.2015 or .CC.2014") I get 'error 429 activex can not create this object'.
Before posting my answer I tested your snippet with InDesign CC 2015.4 and Excel 2016 on Windows 10 and it worked for me without any errors.
It appears i was in contact with InDesign and didnt know it. this is because the local winow at the bottom of the screen show me nothing at all. i have attached a picture.
I am somewhat used to scripting for illustrator and this local windows is full of all the classes, object, and elements that each variable/object contains. For InDesign there is nothing; the value is <no Variable>. If this is not normal then perhaps you know why?
Thank you very much for your help.
Please mark Kas's answer as correct
I have a similar problem on my side: both in VBA and VB6. Though some properties are available:
Now look at this screenshot
Note that something went totally wrong here: variables show something strange in the "Type" column -- e.g. Document/Colors.
My guess is that Adobe simply stopped supporting VB because it's not popular among scripters and with newer versions of InDesign it doesn't work properly.
In 2006 I wrote the VB version of my "Resize Images" script. I just wondered how I could write such a complex script without the "Locals" window so I opened it and run it step-by-step. Variables are available here:
I am hoping to spend a lot less time "working" and a lot more time scripting. Just with what i have managed in the last 2 months i have save my company(Fashion Design) hundreds of hours of work.
Looking forward to the next project.
Just backing up what Kas said (not that he needs it!) and your conclusion.
Regarding InDesign DOM execution (i.e. tell InDesign to do something) both applescript and more so vbs or vb are a complete waist of time (the scripting doctor would disagree with the applescript part but ...).
They serve 3 "Useful" functions in InDesign.
1) They can do OS stuff that js can't
2) They can communicate with other programs. (i.e. send data from Outlook to InDesign or the reverse)
3) They can me made into binary executable files.
Perhaps the most important advantage of js it community. There are millions of js programmers and hundreds of thousands of js libraries, so when you need to do something and search for it or ask about it your much more likely to get your answer.
Here on the forum there is really a limited amount of participants who can answer even the most basic questions on vbs or applescript.
The documentation and scripting references are sorely lacking in them.
I am now quite convinced that js is the right direction. thank you for your additional information.
I have also been listening to an online tutorial and it seam the shift into js from VBA will be very light. time will tell.
Do you use Adobe's Extendedscript Toolkit when righting scripts? or do you have another recommendation?
I have written many times and will write many more times.
The ESTK is pathetic.
I use sublime text with autocompletes and builds for InDesign, Illustrator, vbs, applescript, node.js etc.
The build meaning that I can execute the script strait from the sublime text.
The are thousands of plugins for ST of which I use quite a lot including git.
One can slowly get the hang of what's going to be useful to add on.
I do not use $.writeln for logging rather I use my on log system that is a completely different world.
Hundreds if not thousands of times quicker and better than the pathetic console provided by the ESTK.
ST has a fully functional trial for as long as one wants and cost $70 for the license version if one decides to keep it.
Brackets is a good alternative so it Atom they are both free. I have not used either of them.
The are also some pricey options.
That said there is some room for the ESTK to execute the scripts sometimes. I.e. write them in ST or whatever and if needed execute them with the ESTK.
Just my opinionated opinion, regards,