S
src
Hi there,
Recently we've begun to standardize our formats and update all of our
documents at work. I've created a master template which has all of
our boilerplate text, headers and footers.
Oftentimes, a user will open a document based on this template, and
need to copy an paste text from an old document that may have wildy
different Paragraph Styles (which messes up our standard format).
I've created a macro that does a Paste Special and restricts the
Paragraph Styles that are allowed. All Styles that don't match our
master template's get assigned Normal Style.
My problem is that once pasted, there is no Undo available. Here's a
clip of the code:
____
Sub PasteFromOtherDoc()
' Will allow pasting of Text from other (customer) documents but not
pasting of Styles.
' Turns on document protection>styles, pastes, then unprotects.
'
With ActiveDocument
.Styles("1 / 1.1 / 1.1.1").Locked = True
.Styles("1 / a / i").Locked = True
.Styles("Article / Section").Locked = True
.Styles("Balloon Text").Locked = False
.Styles("Block Text").Locked = True
.Styles("Body Text").Locked = True
Recently we've begun to standardize our formats and update all of our
documents at work. I've created a master template which has all of
our boilerplate text, headers and footers.
Oftentimes, a user will open a document based on this template, and
need to copy an paste text from an old document that may have wildy
different Paragraph Styles (which messes up our standard format).
I've created a macro that does a Paste Special and restricts the
Paragraph Styles that are allowed. All Styles that don't match our
master template's get assigned Normal Style.
My problem is that once pasted, there is no Undo available. Here's a
clip of the code:
____
Sub PasteFromOtherDoc()
' Will allow pasting of Text from other (customer) documents but not
pasting of Styles.
' Turns on document protection>styles, pastes, then unprotects.
'
With ActiveDocument
.Styles("1 / 1.1 / 1.1.1").Locked = True
.Styles("1 / a / i").Locked = True
.Styles("Article / Section").Locked = True
.Styles("Balloon Text").Locked = False
.Styles("Block Text").Locked = True
.Styles("Body Text").Locked = True