Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-11-2023, 03:23 PM
Guessed's Avatar
Guessed Guessed is offline Possibility to copy and paste plain texts with image? Windows 10 Possibility to copy and paste plain texts with image? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
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
 

Tags
copy and paste, image insert, template document styles



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Between Two Headings/Texts Noob_VBA Word VBA 14 12-01-2021 12:28 PM
copy paste webp image from internet to word fails to appear DBenz Word 4 05-20-2020 06:49 PM
Need to copy texts from excel and paste in to the Notepad++ in between the particular tags ganesang Word VBA 2 08-27-2018 02:05 AM
Possibility to copy and paste plain texts with image? Keyboard shortcut to paste as plain unformatted text. Wyck Word 1 09-21-2016 03:49 PM
OneNote - Copy and paste image to the table MartinK OneNote 0 09-03-2013 05:08 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:18 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft