The seal fits between the top of the car and a set of rails inside. The front and side rails unscrew, the back rail is riveted to the sunroof frame.
Just pull the old one out, making sure you remove all the flange part, and lubricate the new one with armorall or some other silicone spray lube and shove it in. Ribbed side of flange goes up. The seal is in two parts. You may only need to replace the rear part. If the flange is torn off (as I suspect it is) you will need to take a small screwdriver or icepick or such to dig out the part in the slot. Make sure you remove all of it.
Procedure is 77-130 in the MB factory manual for W124 chassis.
You can unscrew the clamping rails it you need to, but you will need to set them to 3mm from the roof somehow when you put them back in. You may need to remove the wind deflector to do this (MB Procedure 77-250).
The rain gutter (the plastic part at the rear of the roof) is separate and you may need a separate seal for that.
I think this is the easiest part of sunroof repair!
1972 220D ?? miles
1988 300E 200,012
1987 300D Turbo killed 9/25/07, 275,000 miles
1985 Volvo 740 GLE Turobodiesel 218,000
1972 280 SE 4.5 165, 000 - It runs!