Jump to content
Macro Express Forums

koden

Members
  • Posts

    248
  • Joined

  • Last visited

Posts posted by koden

  1. I have some mails that all look like this:

     

    - Job : WIXAFL1M

    - Owner : 8780 CSC.CPH.CSS.SC.TRF

    - code : S222

    - Stepname : STEPUC

    - Procname : PS1

    - Jobnumber : JOB04777

    - Application : AIOKDK10A

    - Workstation : IXA1

    - Operation text : uc job mod xapta

    - Start Time : 00.15.13

    - Stop Time : 10.29.50

    - Date : 07-03-2006

     

    I copy job: WIXAFL1M to T1

    I copy code: S222 to T2

    I copy date: 07-03-2006 to T3.

     

    The next mail can have diff. job,code or date.

     

    If the job,code and date in the next mail ALL 3 are the same as in the first mail, the mail has to be deleted, and macro should go to next mail.

     

    If one of the 3 parameters is diff. in mail 2 as in mail 1, the macro should go on.

     

    Until now i have not have date in the macro. Only job and code.

    I copy the job and code to T1 and T2 and paste them to notepad.

    Then I copy the content of notepad to T9 and in the next mail I check if T1 AND T2 are in T9.

    BUT this is not working, because if:

     

    mail 1 has job: A and code: 1 (put in my notepad)

    mail 2 has job: A and code: 2 (put in my notepad)

    mail 3 has job: B and code: 2 (put in my notepad)

    mail 4 has job: B and code: 1

     

    Then mail 4 will be deleted, because notepad (T9) has a B and a 1.

     

    So I have to put T1,T2 and now date T3 together, and in the "next" mail check if T1,T2 and T3 are matching T1,T2 and T3 from the first mail.

     

    But where can I save the 3 variables together and make a matching check on them?

    Is excel a possibility, because it has fields that are numbered???

     

    There is more in this Thread if you don't understand me:

     

    http://pgmacros.com/community/index.php?showtopic=990

  2. Hello again

     

    This problem I had here is now working.

     

    But now I have one more variable that I have to check on.

    In the mail there is a date

    Ex. like this 23-03-2006

     

    This date i copy to variable T15

     

     

    The macro should only delete mails that has same job and code on the SAME DATE. NOT delete if job and code are the same but have another date.

     

    But I can't see how I will get it to check on this date also??

     

    Do you understand, or should I write it more specific???

  3. Sorry...but I'm not so good to this IF.

     

    My IF statement look like this:

     

    If variable T9 contains variable T5

    AND

    If variable T9 contains variable T6

    OR

    If variable T8 contains Restart

     

    Then delete mail

    End IF

     

    I surpose that the email will be deleted if T5 and T6 both are present in T9.

    If this is not true it will test if T8 contains restart.

    IF it does the email will be deleted

    If not it will end and go on with the rest of the macro.

     

    Is that right??

     

    And I also has a problem:

     

    T8 contains: 1 Tryg OPC Job Error

     

    I have an IF statement that says that

    If T8 does not contain: Tryg OPC

    Then archive the mail in X folder.

     

    But even if T8 contains Tryg OPC, it sometimes archive mail in X and sometimes not.

    Can this be a timing problem in my IF statement???

  4. Ohh.. I think you look at the first attached macro. I have attached a new one.

    Sorry...I schould have wrote that.

     

    The first one was called test.

    The new one test1.

     

    But it was the same problem, so This works now...ENDIF in line 21 has to be deleted

     

    BUT

     

    then I got a new problem :-)

     

    Now when endif line 21 is gone line 21 is if variable T8 does not contain Tryg

     

    This IF statement doesnt work if T8 contains f.ex. "5 test af ikke"

     

    So the first IF statement with T5,T6 and T9 is not true.

    That works.

     

    But when the second statement is true: if variable T8 does not contain Tryg

    Then it seems to jump out of this macro and go on with the next macro.

     

    Do I have a problem with my endif??? :-)

  5. I have tested now...

     

    This happens:

     

    The first IF statement is true

    (save all job...txt contains the same as T5 and T6)

     

    The macro close the OPC mail and the request (as the IF statement tells it to do).

     

    Then I can see the macro does the paste T5 and T6 into save all job...txt.

    And just after this it says:

     

    The specified window OPC could not be found on your computer. The macro will be aborted.

     

    This is what should have been happend:

     

    After the first IF statement have been done (because it was true), the macro should jump to the last ENDIF in this macro.

  6. I'm not sure, but I can try tomorrow morning..

     

    I just know that it delete the mail and shut down the request as it has to do in the first IF statement.

     

    After there the error comes, that tells it can't activate OPC.

    (OPC is the mail that it has shut down in the first IF statement).

     

    But anyway...I can see it's dificult to help with this inf.

    I will get some more inf. :-))

  7. It's called remedy.

    It has a limited charaters.

    But not that few...

     

    But if I made a simple ctrl+c from my mail and a ctrl+v in the same field there is no problem.

     

    And if I paste my T variable in notepad it's also no problem.

     

    It's only when the T var. is pasted out in this remedy field...

  8. I have copyed this into T2:

     

    Job : WPIF808P

    - Owner xxxxxxxxxxxxx

    - code : 0008

    - Stepname : INFOPPG

    - Procname : SASPROD

    - Jobnumber : JOB03547

    - Application : APIFM1300

    - Workstation : CPU2

    - Operation text : Bevæg til xxx pre pol

    - Start Time : 05.30.16

    - Stop Time : 05.30.26

    - Date : 02-03-2006

    --------------------------------------------------------------------------------

    --------------------------------------------------------------------------------

     

    When my macro paste it out in my program, the only thing it types is:

     

    Job : WPIF808P

    - Owner

     

    But if i type T2 out in notepad, it all comes out.

    So T2 contains it all.

     

    Any Idea???

    Something about rich text maybe??

  9. In my macro I copy from a notepad doc. and put it to T1.

    Sometimes the notepad is empty.

     

    I have noticed that T1 then will have the last ctrl+c subject from clipboard instead of a blank.

     

    Can i empty the clipboard like I can empty a T variable, and then copy the empty clipboard to T1??

  10. a little problem.

    How do I check that notepad document has T1 and T2 ???

     

    I can't find a function that can activate notepad and check contain of the notepad document ???

     

    Or do I have first to copy all from the notepad into a T variable and check on this T variable ???

  11. Okay.

    So it has to look like this:

     

    IF T3 contains text1

    text type xxxxxx

    end if

    IF T3 contains text2

    text type yyyyyy

    end if

    IF T3 contains text3

    text type zzzzzzz

    end if

    else

    macro stop

    end if

     

    1. Do I need delays anywhere??

    2. When I use contains will it then check for text1, even is there is more words in T3 ?

  12. I think there is a problem in this.

    T10 has to remember the data 24 hours.

    The macro can be running many times in one day.

    And so far as I have understand T10 will be empty after each run ???

     

    maybe T10 should be a notepad document instead ????

     

    Ex:

     

    When I start at work i run the macro first time this day.

     

    Activate and launch program "save all job and code for this day.txt".

    T11 = Current Email

    T5 = The "Code" in T11

    T6 = The "Job" in T11

    If "save all job and code for this day.txt" does not contain T1

    OR

    If "save all job and code for this day.txt" does not contain T2

    Paste T11 into T2

    Append "save all job and code for this day.txt" with T11

    Else

    Delete email

    End If

     

     

    What would you say to this???

    I surpose that if "save all job and code for this day.txt" contains T1 but not T2, then it will paste T11 into T2

×
×
  • Create New...