shred your veggies like very fine coleslaw. Put them about 1/2" deep in a bowl and put your worms or crickets or whatever in there with the veggies. When the lizard shoots the bugs, bits of greens stick to the tongue. Also sometimes at first the bugs will burrow into the greens and make them move and the lizard will shoot the moving greens. As time goes by, the chameleon will get more and more of a taste for the greens and eventually will go to the bowl and eat them regardless of whether there are bugs in there with them or not.
By the way- pinworms probably were in your bearded dragon all along. Pinworms are extremely common in bearded dragons, and are very species specific- meaning there is a specific species of pinworm for bearded dragon, and another for another species of lizard, etc. They are almost impossible to get rid of because the "eggs" are so tiny and so sticky- they stick to everything and don't rinse off easily (think walls of enclosure, hands, clothing, water dish, food dish- anything that might come into contact with nearly microscopic fecal particles even from the dust). Normally they are not a problem and his body will keep them in check but if your dragon gets stressed (maybe by his "virus" or if enclosure is dirty or he is kept too cool or whatever, then they may take advantage of the weakened lizard and get to be too much for the lizard.
It is possible I suppose if someone had pinworm cysts on their hands and handled crickets at the pet shop after messing with the bearded dragons that your dragon could become infected. But most bearded dragons in captivity or wild already have them anyway- much more likely they were in your lizard when you bought him.
All this, at least is what one of the best known lizard vets in the country explained to me back in the 1990s. I suppose it is possible thinking has changed, but I doubt it. If your vet treated the pinworms and didn't have you practically replace your enclosure and keep him in a very sterile environment during treatment, or unless there is some new drug on the market in the past 15 years for pinworms, odds are your lizard still has them. But then again, odds are very high he has always had them.