Paste with formatting

P

P Ratcliff

I'm going mad with this. I have a very large document with chapters -
each is a section. I have a vba macro which selects the section
containing the cursor, copies the section, opens a new blank document
and pastes the selected area into the new document.

Problem - this was working just fine up until yesterday and now the
paste loses the formatting. I cannot for the life of me figure out
what changed. Going through the code, the selection appears to be just
fine - I can do a manual copy and paste and I get the prompt:
"Recording clipboard style sheet will require copying many styles. Do
you want to use Normal style instead?"
I reply NO and the paste keeps the formatting.
The macro used to prompt me at this spot but now it just continues on
with the paste - and, I guess, uses the Normal template styles so I
don't get my formatting.

Any help is very much appreciated.


Sub getsectionHTML()
Dim curSec

curSec = Selection.Information(wdActiveEndSectionNumber)

ActiveDocument.Sections(curSec).Range.Select

Selection.Copy
Documents.Add DocumentType:=wdNewBlankDocument
Selection.PasteAndFormat (wdFormatOriginalFormatting)

End sub

P Ratcliff
 
P

P Ratcliff

I've narrowed down the problem to some setting inside Word 2003. (?) I
blew away the Normal.dot and now the macro (which is attached only to
the document - the code is not in Normal.dot) works just fine.

Anyone have any idea why? What setting is suppressing or responding
with the default to the message box? FYI, I've tried both options with
Smart Cut and Paste & w Show Paste Options in Tools-Options.
Cheers,
P Ratcliff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top