![]() |
#1
|
|||
|
|||
![]() Greetings. Thank you in advance for viewing my question. The goal is to take 4 digital images from my file and insert onto one page. Preferably with no border. I can insert one image easy enough, but the second image defaults to a second page. Supposedly the image can be moved about with a left drag of the mouse but my efforts result in no movement. |
#2
|
||||
|
||||
![]()
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
I have been looking for this code for so long.
This will literally save me hours and hours of work as I have over 300 photos to tabulate. |
#4
|
|||
|
|||
![]()
Hello everyone, thank you macropod for this macro it is very usefull for me at work. Do you think this macro can be improved, as to autocorrect the captions under the photos inserted if you delete one photo?
What i mean is that if i insert 4 photos and i delete photo 3, the captions under the remaining photos to be in order and photo 4 caption to be automatically deleted. |
#5
|
||||
|
||||
![]()
Since the macro concerns only the insertion of images, not their deletion, the simple answer is: no.
However, if you were to use a multicolumn page layout for wherever you want the pics to appear, together with a specification that there should only be one image per column, deleting an image and its caption will result in all the others updating correctly with no blank cells. Do be aware, though, that this changes the layout from across-then-down to down-then-across.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
![]()
Dear Macropod, thank you for the well thought out VBA code. Unfortunately I experienced and error when attempting to run the macro routine. I am hoping that someone might offer advice in diagnosis the cause of the error.
The error message is: Run-time error '4605': This method or property is not available because this command is not available inside math. The command line where this occurred: Set oTbl = Selection.Tables.Add(Range:=Selection.Range, NumRows:=2, NumColumns:=NumCols) Thank you everyone. Cheers/M |
#7
|
||||
|
||||
![]()
NumCols should be an Integer that you entered in an inputbox. It is defined as Long so conceivably you are not putting an Integer in as the input value.
What are you seeing if you hover over the word NumCols when that line is being debugged?
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#8
|
|||
|
|||
![]()
Hi! Thanks!
There is a way to use the maximum available page area instead of asking for the maximum picture height? Considering a given number of rows and columns (pictures) per page.
__________________
Backup your original file before doing any modification. |
#9
|
|||
|
|||
![]()
Hi Macropod,
I name my pictures 001, 002, 003, etc. because they have to be in a certain order. When I run the program that you provided it inserts the file name into the row, but adds Picture 1:, Picture 2: etc. in front of the file name. is there a way to remove this part in the macro? |
#10
|
||||
|
||||
![]()
You could change:
Code:
With oTbl.Cell(r + 1, c).Range .InsertBefore vbCr .Characters.First.InsertCaption _ Label:="Picture", Title:=StrTxt, _ Position:=wdCaptionPositionBelow, ExcludeLabel:=False .Characters.First = vbNullString .Characters.Last.Previous = vbNullString End With Code:
oTbl.Cell(r + 1, c).Range.Text =StrTxt
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#11
|
|||
|
|||
![]()
Thank you Macropod!
|
#12
|
|||
|
|||
![]()
Your whole solution is utterly elegant. You've just saved me hours. and hours. of work and pain and exasperation. Thank you more than there are words to express.
|
#13
|
|||
|
|||
![]()
Hello, this has saved me soooooo much time so thank you very much!! Can I ask, how would I remove the caption completely? I need the row but to insert my own text. Also, is there a way to number each blank row in every column? So if I have 2 columns per row have them showing as 1. 2. 3. etc?
|
#14
|
|||
|
|||
![]()
Great stuff. Just what I was looking for.
|
#15
|
|||
|
|||
![]()
This is great. I truly thank you for posting this. This will improve my efficiencies in multiple ways.
Can anyone help explain how I'd change the font size and type throughout the photos that this adds (nothing else in the document). If we could justify the captions to wrap a new line at the width of the photos that would be extra great. I will ultimately change the code to always use a vertical picture height of 9 cm. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to insert and hide images | ricecrispies | Excel | 8 | 06-18-2022 04:19 AM |
Mutliple Selection List Box | tbrynard01 | Word | 0 | 09-10-2019 12:56 PM |
Insert images into word form | lfabiof | Word VBA | 1 | 12-24-2017 09:51 PM |
Programmatically insert digital signature into a Word document | tinamanns | Word | 0 | 04-12-2017 01:16 PM |
![]() |
John-N | Mail Merge | 5 | 02-19-2012 07:15 PM |