 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Wayne Herbert Guest
|
Posted: Thu Jan 22, 2004 5:44 pm Post subject: Word OLE Error |
|
|
I am loading a watermark image into a document, which works fine.
The problem is that if I attempt to use a variable to specify the top
and left postions, I get the error, "Process stopped with invalid
callee". Here's the code
var
WaterMarkLeft : single;
WaterMarkTop : single;
WaterMarkHeight : single;
WaterMarkWidth : single;
code
WaterMarkLeft := -7;
WaterMarkTop := 31.5;
WaterMarkHeight := 678.75;
WaterMarkWidth := 455.54;
Word.ActiveDocument.Sections.Item(1).Range.Select;
Word.ActiveWindow.ActivePane.View.SeekView := wdSeekPrimaryHeader;
Word.Selection.HeaderFooter.Shapes.AddPicture(FileName :=
BackgroundFile,
LinkToFile := false, SaveWithDocument := true).Select;
Word.Selection.ShapeRange.Height := WaterMarkHeight;
Word.Selection.ShapeRange.Width := WaterMarkWidth;
Word.Selection.ShapeRange.RelativeHorizontalPosition :=
wdRelativeVerticalPositionMargin;
Word.Selection.ShapeRange.RelativeVerticalPosition :=
wdRelativeVerticalPositionPage;
// ***** - the following line(s) create the error
Word.Selection.ShapeRange.Left := WaterMarkLeft;
Word.Selection.ShapeRange.Top := WaterMarkTop;
// ***** these lines work just fine.
Word.Selection.ShapeRange.Left := -7; //WaterMarkLeft;
Word.Selection.ShapeRange.Top := 31.5; //WaterMarkTop;
According to the VB object inspector, the fields in question are
defined as singles. Additonally, it strikes me as odd that the Height
and Width work just fine.
I'd appreciate any insight into what is going on here.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|