If Then... and?

S

Stella

Can I do an If then statement that then refers to the following If then
statement and relate the two with an and?

Example: the code inserts one picture that position on the page depends
onthe format of the second picture
 
E

Ed Bennett

Stella said:
Can I do an If then statement that then refers to the following If then
statement and relate the two with an and?

Example: the code inserts one picture that position on the page depends
onthe format of the second picture

In short: "It depends"

You can, for instance, put the first picture into a variable that you
then test once the second picture is there, and move accordingly.
Alternatively, you could add the second picture first and then add the
first picture second, which allows you to test the condition as the
picture is inserted, rather than correcting it post-facto.

I can't offer more detailed help without better understanding the problem.
 
S

Stella

Thats what I want to achieve:

If picture1 is height > length and picture2 is as well height > lengths
under these conditions
position picture1 Left Top and picture2 Left Top

Do you still think its best to put the first picture into a variable and
then test once the second picture is there and move accordingly?
 
E

Ed Bennett

Stella said:
Thats what I want to achieve:

If picture1 is height > length and picture2 is as well height > lengths
under these conditions
position picture1 Left Top and picture2 Left Top

Do you still think its best to put the first picture into a variable and
then test once the second picture is there and move accordingly?

That depends on whether Picture1 and Picture2 have been added.

Some proto-code:

Picture1 = (Page).AddPicture(...)
Picture2 = (Page).AddPicture(...)
If (Picture1.Height > Picture1.Width) And (Picture2.Height >
Picture2.Length) Then
Picture1.Top
Picture1.Left
Picture2.Top
Picture2.Left
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top