From: P Ratcliff on 6 Nov 2009 13:20 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
From: P Ratcliff on 6 Nov 2009 14:44 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 On Nov 6, 10:20 am, P Ratcliff <pratc...(a)co.alameda.ca.us> wrote: > 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
|
Pages: 1 Prev: Run Word Macro from Addin Next: help with WordBasic.FormatMultilevel |