My weakness is the accessibility of food at work. Mostly vending machines and the concessionary stand on the ground floor. What has helped me the most is making sure I have nothing less than $20 bills with me, or more than about 50 cents in change (which means I need to bring lunch with me). Otherwise, if there is any stress at all at work, all $1 and $5 bills get "laundered" through the vendings machines by the end of the day, or I might head downstairs to the concessionary stand. The grumpy old lady who runs it lectures you if you give her a $20 bill to cover a candy bar.
The other thing that keeps me in line is reading enough often enough about the dangers of unhealthy food to scare the bejeezes out of myself. It wears off after a while so I have to find new, scarier stuff to read.
I recently finished Gary Taubes' "Good Calories, Bad Calories". It convinced me that carbs make it very difficult to lose weight so I would make things like cereal and pasta as scarce as possible, unless it's a really high fiber option. It also convinced me that moderate exercise at least every other day is important to keeping up your metabolism up (combatting insulin resistance so your fat cells will release fat), but doesn't work well as a calories in/calories out balance, it will just make you hungrier so you'll eat more.
Good luck to you.