Author: Jonas Bilinkevicius
I'm trying to insert a picture in a document and sent it to the back, with the text
over the picture using automation.
Answer:
If Doc is a Word document:
1 { ... }2 var3 Pic: Word2000.Shape;
4 Left, Top: OleVariant;
5 { ... }6 7 {To add a pic and make it appear behind text}8 Left := 100;
9 Top := 100;
10 Pic := Doc.Shapes.AddPicture('C:\Small.bmp', EmptyParam, EmptyParam, Left, Top,
11 EmptyParam, EmptyParam, EmptyParam);
12 Pic.WrapFormat.Type_ := wdWrapNone;
13 Pic.ZOrder(msoSendBehindText);
14 {To get a watermark effect}15 Pic.PictureFormat.Brightness := 0.75;
16 Pic.PictureFormat.Contrast := 0.20;
17 {To make any white in a picture transparent}18 Pic.PictureFormat.TransparencyColor := clWhite;
19 Pic.PictureFormat.TransparentBackground := msoTrue;
20 Pic.Fill.Visible := msoFalse;
21 { ... }