There are two ways of using the adverb hopefully. Traditionally it means ‘in a hopeful way’:
She smiled at him hopefully.
This sense has been used since the 17th century, so it’s very well established. In the second half of the 20th century, a new use developed, with the meaning ‘it is to be hoped that’:
Hopefully we’ll see you tomorrow.
When it’s used in the second way, hopefully is acting as a sentence adverb, a type of adverb that comments on the whole of a sentence rather than just a part of it.
Many people object to the use of hopefully as a sentence adverb. They compare it with other sentence adverbs such as ‘unfortunately’ or ‘clearly’, which can be paraphrased as 'it is unfortunate that ...' or 'it is clear that ...':
Unfortunately, he missed the train. [i.e. it is unfortunate that he missed the train.]
Clearly, they have made mistakes. [i.e. it is clear that they have made mistakes.]
It’s certainly true that you can’t paraphrase hopefully as ‘it is hopeful that’. But this is no reason to ban its use as a sentence adverb: there are no grammatical rules that say the meaning of a word mustn’t be allowed to develop in this sort of way.
The second meaning of hopefully is now much more common than the traditional one and there’s no need to avoid it in most everyday contexts. Nevertheless, if you are making a formal speech or writing formally (e.g. preparing a report or drafting a job application), you should be aware that there are people who intensely dislike this usage. For some, it has become almost a test case of ‘correctness’ in the use of English, even if the arguments on which their view is based are not very strong. Consequently, in this type of formal situation, it would be better to choose a different adverb or reword your sentence altogether.
You can read more rules and guidelines about adverbs on the Oxford Dictionaries blog. Here you will find more examples of correct and incorrect use of adverbs.
Back to Usage.
You may also be interested in: