This checks for a particular web opened in FrontPage. It works but I would like to know how to do the loop in VBScript.
Could someone please show me an example of a For loop using the count and Url properties?
<html>
<head>
<title>Check FP Status</title>
<script language="VBScript">
Sub HowManyWebsOpen()
Dim objFP,Object
Set objFP = CreateObject("FrontPage.Application"
NumberOfWebsOpen = objFP.Webs.count
Set objFP = Nothing
End Sub
Sub WebURLs(number)
Dim objFP,Object
Set objFP = CreateObject("FrontPage.Application"
WebURL = objFP.Webs(number).Url
Set objFP = Nothing
End Sub
</script>
<script type="text/javascript">
NumberOfWebsOpen = 0
WebURL = '';
Path = 'C:\\folder'
function CheckForFPOpenToWeb() {
FpOpen = false
HowManyWebsOpen()
for (var i=0;i<NumberOfWebsOpen;i++) {
WebURLs(i)
Local_Path = WebURL.replace(/\//g,"\\".slice(8,WebURL.length)
if (Path == Local_Path) {
FpOpen = true
}
}
if (FpOpen) {
alert('open')
} else {
alert('closed')
}
}
</script>
</head>
<body>
<input type="button" value="Check" onclick="CheckForFPOpenToWeb()">
</body>
</html>
Could someone please show me an example of a For loop using the count and Url properties?
<html>
<head>
<title>Check FP Status</title>
<script language="VBScript">
Sub HowManyWebsOpen()
Dim objFP,Object
Set objFP = CreateObject("FrontPage.Application"
NumberOfWebsOpen = objFP.Webs.count
Set objFP = Nothing
End Sub
Sub WebURLs(number)
Dim objFP,Object
Set objFP = CreateObject("FrontPage.Application"
WebURL = objFP.Webs(number).Url
Set objFP = Nothing
End Sub
</script>
<script type="text/javascript">
NumberOfWebsOpen = 0
WebURL = '';
Path = 'C:\\folder'
function CheckForFPOpenToWeb() {
FpOpen = false
HowManyWebsOpen()
for (var i=0;i<NumberOfWebsOpen;i++) {
WebURLs(i)
Local_Path = WebURL.replace(/\//g,"\\".slice(8,WebURL.length)
if (Path == Local_Path) {
FpOpen = true
}
}
if (FpOpen) {
alert('open')
} else {
alert('closed')
}
}
</script>
</head>
<body>
<input type="button" value="Check" onclick="CheckForFPOpenToWeb()">
</body>
</html>