Visual Basic Example #6

This is an example of using Visual Basic to scan a Milestones Professional schedule for specific symbol tags.   Try this example
    
The Code: 
     

'Public Sub Main()
Dim objmilestones As Object
Set objmilestones = GetObject("c:\test\symboltags.mla")
With objmilestones
    .Activate

'ABC
    rownumber = .GetLineOfSymbolTag("ABC")
    symbolnumber = .GetSymbolNumberOfSymbolTag("ABC")
    .DisplayMessageBox "Found symbol ABC at row: " + Str(rownumber) + "  Symbol: " + Str(symbolnumber)

    rownumber = .GetLineOfSymbolTag("DEF")
    symbolnumber = .GetSymbolNumberOfSymbolTag("DEF")
    .DisplayMessageBox "Found symbol DEF at row: " + Str(rownumber) + "  Symbol: " + Str(symbolnumber)

    rownumber = .GetLineOfSymbolTag("KLM")
    symbolnumber = .GetSymbolNumberOfSymbolTag("KLM")
    .DisplayMessageBox "Found symbol KLM at row: " + Str(rownumber) + "  Symbol: " + Str(symbolnumber)

    rownumber = .GetLineOfSymbolTag("XYZ")
    symbolnumber = .GetSymbolNumberOfSymbolTag("XYZ")
    .DisplayMessageBox "Found symbol XYZ at row: " + Str(rownumber) + "  Symbol: " + Str(symbolnumber)

    .keepScheduleOpen

End With


End Sub

 

To try this example:
Click here to download a Zip file (MilestonesVBExample6.Zip) containing the above VB code.
 
Click here to visit our main programmer's page.