A few questions and possible answers...
What size tank was the fish in?
The common size to keep them happy is 1 gallon. The ammonia doesn't build up quite so quickly, and gives them room to explore and stay happier.
Anything smaller requires that you change the water 100% almost daily. And changing the water too often can sometimes stress them out.
Why were you changing water everyday?
Changing water everyday on a grown fish isn't neccessary, and it can also stress a newly acquired fish out some. Best to let them get accustomed to their new surroundings for a few days before swishing them around.
Also, just changing 10% of the water, on any schedule, isn't going to remove the ammonia. Anything smaller then a 5 gallon needs 100% changes imho. With a 1 gallon you can get away with changing them every 4 days @ 100%.
Were you using a water dechlorinator w/heavy metal remover? And if you were how much?
If you weren't, this could most definately be your problem.
If you were, did the brand you used remove ammonia and hard metals?
Hard metals are just as dangerous as ammonia in some instances.
Did you have a thermometer and/or lid on the tank?
If you had a thermometer, what was the water temp?
Some bettas don't like being in water colder then 70 degrees. If the water was colder then that it could have had adverse effects on the fish, especially if it wasn't use to it. I know the fish at Walmart are usually at 74-78 degrees, due to the temp in the stores and being kept where drafts cannot have direct access to them (i.e. inside the water change stalls or inside a shelf).
If your tank had no lid, and you have an over head air vent in the office..the air conditioning, when blowing, can make the air above the surface much colder then the water temp. This can also have adverse effects on a betta, since they come up often to breathe air from the surface. It can also keep your water at much colder temps while it is on, and the temp variations can be tough on some fish.
**********************
Also, you might want to feed them more then only 4 pellets a day (unless you see that they do not eat the pellets, a moldy pellet on the tank floor = certain sickness).
I feed mine a min. of 4 pellets 2 times a day...mixing in some frozen blood worms several times a week, plus a cooked pea once a week, and they fast for 1 day as well.
**********************
These are just suggestions, not accusations. Please don't take them as such.
Just evaluate them according to your situation and factor them in. Any combination can result in a bad experience.
Don't give up, and don't feel bad. Keeping fish isn't easy and takes practice...and you can't get better by quitting.
**edited** so maybe it is easier to read..looked hard once I posted it lol.