Although "me" is not a four-letter word, people are often still reluctant to use it in sentences. This hearkens back to faint memories of elementary grammar classes in which we were told not to write, "Me and John went to the store," or "Bill and me walked to town."
Now, in an effort to correct ourselves, we often incorrectly replace "me" with "I," or the even more questionable, "myself" in almost every sentence. And doing so often creates new grammatical errors rather than fixing the original perceived mistake.
Unfortunately, the traditional grammar rule, "The first person singular pronoun is 'I' when it's a subject and 'me' when it's an object" only helps those who remember what a subject or an object of a sentence is.
So here's an easier way of dealing with the pesky "I," "me" or "myself" problem.
To avoid confusion about which pronoun to use, simply make the sentence singular.
Sentence in question:
"The document was given to Mary and I."
You wouldn't say:
"The document was given to I."
You shouldn't say:
"The document was given to myself." (Use "myself" only when you have used "I" earlier in the same sentence: "I fixed the error myself.")