Spoilers for TNG episodes "Elementary Dear Data" and "Ship in a Bottle".
In "Elementary Dear Data", LaForge accidentally creates a sentient computer program based on the villain Moriarty from Arthur Conan Doyle's "Sherlock Holmes" books, when he asks the holodeck to create a Shelock Holmes scenario with an adversary that is capable of defeating Data. After the Moriarty program convinces the crew that it is indeed sentient, it tries in many ways to leave the holodeck, and Picard explains that the technology for that doesn't exist and he promises to provide Moriarty with such technology as soon as it becomes available. The sequel episode revolves around the same quest, with the Moriarty program still trying to find a way out of the holodeck and into the real world. In both episodes, Picard seemed sincere in his promises to Moriarty that he would help if he could, but the technology simply doesn't allow it.
But then if such a technical feat is impossible, why is the Doctor on Voyager able to pull it off so easily? Can't the technology that allows him to appear anywhere in the ship be easily applicable to the Moriarty program as well ? Or was Picard lying, and he never had the intention of helping him?