![]() |
|
#1
|
|||
|
|||
|
Why does only the second picture anchor is placed at the last paragraph on the page?
first picture is anchored at the top of the document (first paragraph) Code:
Set doc = ActiveDocument
Set Parag = doc.Paragraphs.Last
Set shpShape = doc.Shapes.AddPicture( _
FileName:=strFilename1, _
Anchor:=Parag.Range)
With shpShape
.LockAspectRatio = msoTrue
.WrapFormat.Type = wdWrapFront
.Top = 20
.Left = 350
End With
Set shpShape2 = doc.Shapes.AddPicture( _
FileName:=strFileName2, _
Anchor:=Parag.Range)
With shpShape2
.LockAspectRatio = msoTrue
.WrapFormat.Type = wdWrapFront
.Top = 30
.Left = 250
End With
|
|
#2
|
|||
|
|||
|
The solution I found is from the old thread on this forum.
https://www.msofficeforums.com/word-...0-vba-tip.html One has to insert an InLineShape then convert it to shape. Then it works consistently. Otherwise I got some weird results (e.g., shapes were positioned differently when debuging with F8 and when the code was run with F5) |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Changing position of page numbers | sajeel | Word | 4 | 06-05-2015 09:45 AM |
| Different page number position | Yankel | Word | 2 | 08-01-2014 04:48 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 |
| lock picture position and scaling | sizis | Drawing and Graphics | 0 | 08-27-2013 04:22 AM |
WORD Macro - import picture - resize - position - page break - loop
|
Nano07 | Word VBA | 2 | 11-02-2011 05:14 AM |