Hey guys. I've got a minor bit of code that is currently working, but I would really like to improve it if possible. I'm not a programmer so bear with me. I've got the code below nested in a Do loop that basically is simulating a status bar. It is really just resizing cells in a table based on the outcome of the If statements and some basic calculations earlier on. As you can see it updates at 4 intervals, which is fine, but is a bit clunky. What I would rather do is to pass a variable to the width field. That way I can just constantly recalculate the variable in the Do loop and have it more accurately update through every iteration.
Any ideas? Is this even a possibility?
Thanks for your help!
Set objTextRange = objDocument.body.CreateTextRange()
objTextRange.Text = ""
objDocument.Writeln "<html><head><title>Service Status</title></head>"
objDocument.Writeln "<body bgcolor='white'>"
objDocument.Writeln "<table border='0' bordercolor='#000000' style='background-color:#FFFFFF' width='300' height='60' cellpadding='0' cellspacing='0'>"
objDocument.Writeln "<tr><th>Fields found...</th></tr>"
objDocument.Writeln "<table border='1' bordercolor='#000000' style='background-color:#FFFFFF' width='300' height='30' cellpadding='0' cellspacing='0'>"
objDocument.Writeln "<tr>"
If intRow < intRow25 Then
objDocument.Writeln "<td style='background-color:#0C07AF' width='40%'></td>"
objDocument.Writeln "<td style='background-color:#FFFFFF' width='60%'></td>"
ElseIf intRow > intRow25 AND intRow < intRow50 Then
objDocument.Writeln "<td style='background-color:#0C07AF' width='60%'></td>"
objDocument.Writeln "<td style='background-color:#FFFFFF' width='40%'></td>"
ElseIf intRow > intRow50 AND intRow < intRow75 Then
objDocument.Writeln "<td style='background-color:#0C07AF' width='80%'></td>"
objDocument.Writeln "<td style='background-color:#FFFFFF' width='20%'></td>"
ElseIf intRow > intRow75 AND intRow < intRow100 Then
objDocument.Writeln "<td style='background-color:#0C07AF' width='100%'></td>"
objDocument.Writeln "<td style='background-color:#FFFFFF' width='0%'></td>"
End If
objDocument.Writeln "</tr>"
objDocument.Writeln "</table></table>"
objDocument.Writeln "</body></html>
Any ideas? Is this even a possibility?
Thanks for your help!
Set objTextRange = objDocument.body.CreateTextRange()
objTextRange.Text = ""
objDocument.Writeln "<html><head><title>Service Status</title></head>"
objDocument.Writeln "<body bgcolor='white'>"
objDocument.Writeln "<table border='0' bordercolor='#000000' style='background-color:#FFFFFF' width='300' height='60' cellpadding='0' cellspacing='0'>"
objDocument.Writeln "<tr><th>Fields found...</th></tr>"
objDocument.Writeln "<table border='1' bordercolor='#000000' style='background-color:#FFFFFF' width='300' height='30' cellpadding='0' cellspacing='0'>"
objDocument.Writeln "<tr>"
If intRow < intRow25 Then
objDocument.Writeln "<td style='background-color:#0C07AF' width='40%'></td>"
objDocument.Writeln "<td style='background-color:#FFFFFF' width='60%'></td>"
ElseIf intRow > intRow25 AND intRow < intRow50 Then
objDocument.Writeln "<td style='background-color:#0C07AF' width='60%'></td>"
objDocument.Writeln "<td style='background-color:#FFFFFF' width='40%'></td>"
ElseIf intRow > intRow50 AND intRow < intRow75 Then
objDocument.Writeln "<td style='background-color:#0C07AF' width='80%'></td>"
objDocument.Writeln "<td style='background-color:#FFFFFF' width='20%'></td>"
ElseIf intRow > intRow75 AND intRow < intRow100 Then
objDocument.Writeln "<td style='background-color:#0C07AF' width='100%'></td>"
objDocument.Writeln "<td style='background-color:#FFFFFF' width='0%'></td>"
End If
objDocument.Writeln "</tr>"
objDocument.Writeln "</table></table>"
objDocument.Writeln "</body></html>