Rory McIlroy has been on the driving range ahead of the Open Championship, with the Northern Irishman searching for a first major in four years.