Metformin for weight loss

Does it work? I need to lose weight before I can get pregnant. I had preeclampsia last pregnancy and want to lose 45