To quote the FAQ:
Q: After rolling a “7,” can I still trade with another player or blackmail him before moving the robber?
A: Trading: No. (...)
This is to prevent players from using a trade to save themselves from the robber. After moving the robber, you can do whatever you want: build, trade, play development cards... just like any other turn.