![]() |
|
|
|
#1
|
||||
|
||||
|
IMHO, you'd do better to use a 'proper' PDF to Doc conversion package. Be that as it may, if you insert the 'PDF' page image, then immediately run the following macro, it will be resized to the page size and postioned behind the text.
Code:
Sub FormatPDFPage()
Application.ScreenUpdating = False
With Selection
If .InlineShapes.Count > 0 Then .InlineShapes(1).ConvertToShape
If .ShapeRange.Count = 0 Then Exit Sub
With .ShapeRange(1)
.LockAspectRatio = msoTrue
.Width = Selection.Sections(1).PageSetup.PageWidth
If .Height > Selection.Sections(1).PageSetup.PageHeight Then
.Height = Selection.Sections(1).PageSetup.PageHeight
End If
.WrapFormat.Type = wdWrapBehind
End With
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#2
|
|||
|
|||
|
Thanks Paul. I'm going to try some of those ideas in updating the macros I put together yesterday from bits I found on the Internet. I particularly like the use of PageWidth and PageHeight. I ended up using 2 macros - one to select and insert the Image, and the other to scale and position it.
As far as converting the PDF is concerned, this is pretty much a last resort. The main problem is that the PDF is just made up of flat images - there's not much for a conversion tool to work with. Abbyy FineReader made the best attempt, using the OCR'd text behind the PDF image (outputting as PDF), but for some reason it reduces the image quality which wasn't brilliant to begin with - and of course I couldn't see how well it had managed to interpret the text. Outputting as a Word Document showed that it hadn't done particularly well at all, even with a load of manual training of the OCR engine. Eventually I gave up and chose unformatted text from the OCR and started recreating the documents manually. Anyway, this is the code I've come up with, in two parts because it seems that the picture doesn't gain focus after the first macro inserts it, and so using With Selection fails. Quote:
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Help with Document Properties Prompt Macro
|
KJJ | Word VBA | 14 | 11-10-2016 08:18 PM |
| Powerpoint automatically changing picture size when adding a picture (2010) | One_Life | PowerPoint | 7 | 01-20-2012 06:57 AM |
WORD Macro - import picture - resize - position - page break - loop
|
Nano07 | Word VBA | 2 | 11-02-2011 05:14 AM |
Macro for printer properties
|
kjk20 | Word VBA | 6 | 07-19-2011 06:18 AM |
| Macro to put content into keywords properties? | erik2000 | Word VBA | 3 | 03-05-2010 10:14 PM |