![]() |
|
|
|
#1
|
||||
|
||||
|
I think VBA will be relatively straightforward if the shape is always the same. I would be inclined use inline shapes though as it takes a lot of the complexity away.
If you post a sample document showing a couple of the graphics as you expect to see them then I can probably offer some code that would reproduce that from a folder of images.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
#2
|
|||
|
|||
|
Quote:
I'm using a shape instead of inserting directly because each photo size is dynamic. I managed to write a vba that fill all shapes in a document with specified pictures: Code:
Sub FillShapesWithPictures()
Dim dialog As FileDialog
Dim selectedFiles As FileDialogSelectedItems
Dim i As Integer
Set dialog = Application.FileDialog(msoFileDialogFilePicker)
dialog.Title = "Select multiple JPG files"
dialog.Filters.Add "JPEG files", "*.jpg; *.jpeg", 1
If dialog.Show = -1 Then
Set selectedFiles = dialog.SelectedItems
i = 1
For Each shape In ActiveDocument.Shapes
If i <= selectedFiles.Count Then
shape.Fill.UserPicture selectedFiles(i)
i = i + 1
Else
Exit For
End If
Next shape
End If
End Sub
Any way to combine them? Regards, Nubuki. |
|
| Tags |
| macro, ms-word, vba |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to extract specific pages (Category) or arrange pages in a mail merge document? | kitlwy | Mail Merge | 7 | 09-30-2021 04:50 AM |
Number Pages - not total pages, but actual pages.
|
Kiminator321 | Word | 8 | 04-29-2020 03:07 PM |
| Scroll through pages on loop | ndearing | Word VBA | 5 | 12-17-2015 08:46 AM |
Placing the same object/picture on all pages but on alternative (mirror position) -
|
alceste | Drawing and Graphics | 1 | 09-29-2013 06:28 PM |
create letter template with fixed position fields and follow up pages
|
Lynn O'Shea | Word | 3 | 05-18-2010 12:32 AM |