• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to add extra spaces in VB Script, i tried Space function but unable to get it

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<html>
<head>
<title>VBScript Test</title>
</head>
<body>
<script language="vbscript" type="text/vbscript">
document.write("Hello <br>World!")
Set wd = CreateObject("Word.Application")
wd.Visible = True
document.write("Hello World!")
wd.Documents.Open "E:\HTML Prog for BCS\Test1.doc"
document.write("Hello" & Space(10) & "World")
Dim rowHieghtDefStart
Dim rowHieghtDefEnd
Dim leftSideCellDefStart
Dim rightSideCellDefStart
Dim cellDefStart
Dim cellDefEnd
Dim cellContentDefStart
Dim cellContentDefEnd
Dim totalScript

rowHieghtDefStart = "<row height=""0.42cm""><br>"
leftSideCellDefStart = "<cell style=""tableCell_withLRowBorders_Right"" override-style=""""><br>"
rightSideCellDefStart = "<cell style=""tableCell_withLRowBorders_Left"" override-style=""""><br>"
cellContentDefStart = "<p style=""tableBody"" align=""center"" xml : space=""preserve"">"
cellDefStart = "<cell style=""tableCell_withBorder"" override-style=""""><br>"
cellContentDefEnd = "hi</p><br>"
cellDefEnd = "</cell><br>"
rowHieghtDefEnd = "</row><br>"

'document.write(rowHieghtDefStart)
'document.write(leftSideCellDefStart)
'document.write(cellContentDefStart)
'document.write(cellContentDefEnd)
'document.write(cellDefEnd)
'document.write(rowHieghtDefEnd)
'document.write("Hello World!")
For Each t In wd.ActiveDocument.Tables
s = s & "Table" & vbcrlf
For i = 1 To t.Rows.Count
'totalScript = rowHieghtDefStart
document.write(rowHieghtDefStart)


'Response.Write (rowHieghtDefStart & vbCrLf)
'response.write("<br>")
For Each c In t.Rows(i).Cells
document.write(Space(10))
document.write(cellDefStart)
document.write(cellContentDefStart)
'document.write(Replace(c.Range.Text, vbCr & Chr(7), ""))
document.write(c.Range.Text)
document.write(cellContentDefEnd)
document.write(cellDefEnd)

Next
'totalScript = totalScript & rowHieghtDefEnd
document.write(rowHieghtDefEnd)
Next
Next


</script>
</body>
</html>
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic