After fighting in Switzerland under Guillaume Brune in 1798, where he Forced the crossing of Gümmenen, he joined Bonaparte's Egyptian expedition. During this episode, he fought at the Battle of the Pyramids, the Siege of El Arish, the Siege of Jaffa, the Battle of Mount Tabor and the Siege of Acre. After the latter action, he assumed command of the division when its commander Louis Bon was killed. After Bonaparte abandoned the army, Rampon participated in the Battle of Heliopolis in March 1800. During the Battle of Alexandria on 21 March 1801, he led the French center. He returned to France in 1801, having been named a general of division in 1800. In 1802 he took a seat in the Senate and retired from the army.