Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Publisher / Programming / July 2007

Tip: Looking for answers? Try searching our database.

If Then... and?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stella - 08 Jul 2007 10:20 GMT
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
Ed Bennett - 08 Jul 2007 19:25 GMT
> 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.

Signature

Ed Bennett - MVP Microsoft Publisher
http://ed.mvps.org

Stella - 09 Jul 2007 10:26 GMT
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?

> > Can I do an If then statement that then refers to the following If then
> > statement and relate the two with an and?
[quoted text clipped - 11 lines]
>
> I can't offer more detailed help without better understanding the problem.
Ed Bennett - 09 Jul 2007 13:15 GMT
> Thats what I want to achieve:
>
[quoted text clipped - 4 lines]
> 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

Signature

Ed Bennett - MVP Microsoft Publisher
http://ed.mvps.org

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.