Home > OS >  Want to use the macro implementation, inserted into the word in the picture (embedded mode) automati
Want to use the macro implementation, inserted into the word in the picture (embedded mode) automati

Time:05-24

Want to use the macro implementation, inserted into the word in the picture (embedded mode) automatic typesetting function:
Insert the 50 photos in a word, each photo width 4, 5 cm high, 4 copies of pictures of 1 line, separated with a space between images, all images that do,
Set the batch size 4 * 5 cm high, I use macros have been implemented,
For I=1 To ActiveDocument. InlineShapes. Count
ActiveDocument. InlineShapes (I). The Width=4 * 28.35
ActiveDocument. InlineShapes (I). Height=5 * 28.35
Next I
Knock the next photo copy, separated by Spaces, carriage returns, using a macro how?

CodePudding user response:

Try just now, the following as is possible, there is an accident, first took all the pictures to a variable, then paste the picture, the variable images should also increased; So, so we have to keep the original image individual first in an array,
 Option Explicit 


Sub Do4Pics ()

Dim xInShps As InlineShapes
Dim xShp1 As InlineShape
Dim xShps (1 To 100) As InlineShape
Dim As Integer I
Dim iCnt As Integer


The Set xInShps=ActiveDocument. InlineShapes
ICnt=xInShps. Count
For I=1 To iCnt
The Set xShps (I)=xInShps (I)
Next I
For I=1 To iCnt
The Set xShp1=xShps (I)
XShp1. Select
With Selection
. Copy
. MoveRight unit:=wdCharacter, Count:=1
The TypeText Text:=""
The Paste
The TypeText Text:=""
The Paste
The TypeText Text:=""
The Paste
The TypeText Text:=CRH (13) & amp; CRH (10)
End With

Next I

End Sub
  • Related