Waarom werkt deze macro niet goed?

Status
Niet open voor verdere reacties.

maverickab

Gebruiker
Lid geworden
19 jul 2006
Berichten
11
Hoi,

Ben bezig met een macro om automatisch tekst uit een log file te filteren,
in deze tekst komt ofMapping Rule: P3E -> PM : Activity ofMapping Rule: P3E -> PM : Relation ofMapping Rule Group: Full synch P3e->SAP->P3e voor
Als echter deze laatste in de log file voorkomt gaat ie niet verder met de 'Call SAPError'

Weet iemand wat ik fout doe? (Als ik nl in de debug de Call SAPError een 'schop' geef gaat ie wel verder....:confused:


Sub ExtractErrors()
' this is the main Macro which is always called ---------
' --------------------------------------------------------
' ------------------Determin the Project Link ----------------

' Selection.TypeParagraph
ChangeFileOpenDirectory "C:\Apps\Impress\"
Dialogs(wdDialogFileOpen).Show
Selection.WholeStory
Selection.Copy

Selection.Find.ClearFormatting
Selection.HomeKey Unit:=wdStory
With Selection.Find
.Text = "Project Link"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
LinkName = Selection.Text

'-------------------Determin which Mapping rule is executed ------------
Selection.Find.ClearFormatting
Selection.HomeKey Unit:=wdStory
With Selection.Find
.Text = "Mapping Rule"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
MappingRule = Selection.Text
MappingRule = Left(MappingRule, Len(MappingRule) - 1)

Select Case MappingRule
Case "Mapping Rule Group: Full synch P3e->SAP->P3e"
Call SAPError
Case "Mapping Rule: P3E -> PM : Activity"
Call SAPError
Case "Mapping Rule: P3E -> PM : Relation"
Call SAPError
Case "Mapping Rule: PM -> P3E : Activity"
Call P3Error
Case "Mapping Rule: PM -> P3E : Relation"
Call P3Error
End Select
End Sub

Sub SAPError()

' this Macro is called from main Macro
' for P3e -> PM Mappings

...... rest van de macro


:confused: :confused: :confused: :confused:
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan