A formatting tool enables "smart" copy and paste functions. The "smart" copy
and
paste functions can be invoked in a context-sensitive manner, depending on the
conditions under which the copy and paste functions are implemented. The present
invention will automatically include in a selection a paragraph marker at the end
of a selected paragraph, if every other textual character in the paragraph has
been selected. The present invention will discard a paragraph mark that is included
in pasted text if the pasted text is pasted into the middle of another paragraph,
indicating that the user prefers the formatting of the pasted-into paragraph. The
present invention also reduces inconsistencies in formatting styles that may exist
between source and target documents automatically redefining a style in the target
document to conform to a corresponding style in the source document. The present
invention also automatically adjusts paragraph spacing, in response to text being
pasted into a target document. In response to various scenarios, the present invention
will determine the most likely paragraph spacing intended by the user and will
apply the most probable paragraph spacing to the pasted paragraph. The present
invention also automatically adjusts list, table, and spreadsheet formatting, in
response to such document elements being pasted into a differently-formatted target
document. Finally, the present invention provides a convenient recovery dialog
that may be invoked to alter any automatically-implemented formatting decisions.