There are solenoids, which are electromagnetic linear actuators, and there are linear voltage differential transformers LVDTs, which are electromagnetic linear position sensors.
I don't think you could use one for positioning and sensing because solenoids operate primarily on DC while LVDTs operate on AC. Additionally, solenoid positioning is generally poor and they do not output a position but rather a force, like pneumatics or hydraulics.
Hydraulics can utilize the fact that their working fluid is essentially incompressible for position control - i.e., proportional control until position is reached then just shut inlet and outlet valves, but "compressible" actuators such as pneumatics and solenoids have a SIGNIFICANTLY more difficult time achieving performance even remotely on par with hydraulics.
Controllers for pneumatic positioning exist, as I'm sure they do for solenoids as well, but solenoids are primarily used for on/off switching. Anything more advanced and you're looking at an expensive position controller. LVDTs are also expensive.
Any particular reason a regular geared linear actuator is insufficient?