Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Insert  Text  Into  an  Existing  Microsoft  Word  Bookmark  

 Content of Insert Text Into an Existing Microsoft Word Bookmark.vbs
MD5 Hash: 0BB23A2EBF0BCC590FEE9250EF3E325B
Set objWord = CreateObject("Word.Application")
objWord.Visible = True

Set objDoc = objWord.Documents.Open("C:\Scripts\Test.doc")

Set objNetwork = CreateObject("Wscript.Network")
strUser = objNetwork.UserName
strDomain = objNetwork.UserDomain
strComputer = objNetwork.ComputerName

Set objRange = objDoc.Bookmarks("UserBookmark").Range
objRange.Text = strUser
objDoc.Bookmarks.Add "UserBookmark",objRange

Set objRange = objDoc.Bookmarks("DomainBookmark").Range
objRange.Text = strDomain
objDoc.Bookmarks.Add "DomainBookmark",objRange

Set objRange = objDoc.Bookmarks("ComputerBookmark").Range
objRange.Text = strComputer
objDoc.Bookmarks.Add "ComputerBookmark",objRange



   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a