The Duke of Edinburgh, 92, was last seen in public nearly two months ago as he left the London hospital to recuperate at the Queen's Sandringham estate in Norfolk.
Buckingham Palace said he was making "good progress" and was "in good spirits" as he announced plans to visit the Royal Society of Edinburgh on August 12.
The Duke will present medals at the independent educational charity before joining the Queen at Balmoral, where she is on her annual vacation.
He was admitted to hospital on June 6 after attending a Buckingham Palace garden party.
More From This Section
An exploratory operation was carried out under general anaesthetic the following day, after which he was said to be "progressing satisfactorily".
Buckingham Palace did not reveal why the operation was carried out, but a spokesperson had said at the time that the surgery followed abdominal investigations and was pre-arranged and not an emergency.
The hospital admission meant Prince Philip missed the Trooping the Colour ceremony and events including the traditional Garter service at Windsor Castle and Royal Ascot.
Philip is the longest-serving and oldest-ever spouse of a reigning British monarch, and the oldest-ever male member of the British royal family.