K
Katy White
I need to concatenate the contents of multiple documents into a singe
document. I used VB 6 but am using a word document object. I have most of
this working but I am having trouble keeping the formatting of the original
document when I paste it into the new document. Currently I am using --
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Selection.HomeKey unit:=wdStory
Word.Application.Selection.WholeStory
Word.Selection.Copy
'close the file without changing anything
Word.Application.Saved = True
Word.Applicaton.Close
wdDoc1.Activate 'destination file
Selection.Paste
'end old stuff
Selection.WholeStory
Selection.EndKey unit:=wdStory
'insert a section break
Selection.InsertBreak Type:=wdSectionBreakNextPage
Selection.HeaderFooter.LinkToPrevious = False
This code works perfectly in VBA but for some reason I loose the formatting
in VB. All the information comes over correctly (it's actually all in tables
with headers and footers on each page and some portions of text are bolded)
but the font size does not come over. I tried copying styles from the
original to the new (Normal in the original is 10 pt and Normal in the next
doc is 12 pt) but that doesn't help either.
Suggestions?
document. I used VB 6 but am using a word document object. I have most of
this working but I am having trouble keeping the formatting of the original
document when I paste it into the new document. Currently I am using --
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Selection.HomeKey unit:=wdStory
Word.Application.Selection.WholeStory
Word.Selection.Copy
'close the file without changing anything
Word.Application.Saved = True
Word.Applicaton.Close
wdDoc1.Activate 'destination file
Selection.Paste
'end old stuff
Selection.WholeStory
Selection.EndKey unit:=wdStory
'insert a section break
Selection.InsertBreak Type:=wdSectionBreakNextPage
Selection.HeaderFooter.LinkToPrevious = False
This code works perfectly in VBA but for some reason I loose the formatting
in VB. All the information comes over correctly (it's actually all in tables
with headers and footers on each page and some portions of text are bolded)
but the font size does not come over. I tried copying styles from the
original to the new (Normal in the original is 10 pt and Normal in the next
doc is 12 pt) but that doesn't help either.
Suggestions?