It depends on the Free Hub body that's on it.
8-10 speed bodies are longer than 7 speed bodies to fit the extra cog(s).
However, some recent 7 speeds use an 8-10 speed body with a 4.5mm spacer added before the cassette is installed.
IF you have one of these, just remove the 4.5mm spacer and you are good to go.
The bad news is that most recent 7 speeds seem to use free Wheels instead of Free Hubs.
Freewheel or Cassette?