![]() |
|
#1
|
||||
|
||||
![]()
I've updated the code to attempt to deal with your later requirements. These are each dodgy in their own special way and won't give perfect results in most documents but at least most of the drama will be avoided. In the case of your sample doc, you will be able to spot the shortcomings but it gets pretty close to what you probably wanted.
The replacement of section breaks with hard page breaks is a kludge fix that happens to work on your sample doc but will give non-ideal results on better formatted documents. The graphic conversion to inline shapes failed on a shape in your sample doc so I just put an error skip on that - rather than work out 'why' it failed.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#2
|
|||
|
|||
![]()
Thanks a lot! I didn't even know the existence of ConvertNumbersToText function. It's really handy.
I was writing my own code as well and approached the inline wrapping a bit differently by iterating through all the shapes and do shape.WrapFormat.Type = wdWrapInline after the pasting. I used your code to process another document and notice that some images are still anchored. I can fix this by using my code on the output doc. Don't really know why. I also tried to put InputDoc.Shapes(i).WrapFormat.Type = wdWrapInline after your InputDoc.Shapes(i).ConvertToInlineShape but that didn't help. Graphic conversion failed on 1 probably because that 1 shape is a textbox. I was processing another document several hours ago and run into this situation, which is really hard to spot on. I do notice that your code will put the inlineshape at the beginning of the texts, which in the original file are visually above the image. I'll try to iterate through the paragraphs after the pasting and move that image to be after the texts. Anyway, it's really close to what I want to do and I will keep working on this and ask later. |
![]() |
Tags |
copy and paste, image insert, template document styles |
Thread Tools | |
Display Modes | |
|
![]() |
||||
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 |
![]() |
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 |