BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Word OLE Error

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Wayne Herbert
Guest





PostPosted: Thu Jan 22, 2004 5:44 pm    Post subject: Word OLE Error Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.