View Single Post
 
Old 01-11-2023, 03:23 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,166
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I'm not sure of your 'flush out my custom styles' statement but you are trying to use a sledgehammer to crack an egg by stepping through a paragraph at a time. It is no surprise that you are missing graphics because you only select inline shapes and then further restrict those to one specific type.

I would prep the source file by applying 'Normal' style to the entire content and removing character and paragraph local formatting and then pasting that cleaned content across into the target document.
Code:
Sub CopyPasteToTemplate()
  Dim InputDoc As Word.Document, OutputDoc As Word.Document
    
  Set InputDoc = ActiveDocument
  Set OutputDoc = Documents.Add   'Normal template by default
  With InputDoc.Range
    .Style = wdStyleNormal
    .ParagraphFormat.Reset
    .Font.Reset
    OutputDoc.Range.FormattedText = .FormattedText
  End With
  OutputDoc.Activate
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote