![]() |
|
|||||||
| ASP & VBScript Forum Need help from a webmaster with ASP or VBScript, you may ask in this forum? |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
I am trying to bold a certain word in a document using this script: Const wdReplaceAll = 2 Set objWord = CreateObject("Word.Application") objWord.Visible = True Set objDoc = objWord.Documents.Open("C:\Scripts\Test.doc") Set objSelection = objWord.Selection objSelection.Find.Text = "<%>" objSelection.Find.Forward = True objSelection.Find.MatchWholeWord = False objSelection.Find.Replacement.Font.Bold = True objSelection.Find.Execute , , , , , , , , , , wdReplaceAll Sub Bold_Text_in_Doc() End Sub When I got to run it I get the error on the word "Set" in Set objWord = CreateObject("Word.Application"): Compile error - Invalid outside procedure Does anyone know why? Thanks w0mbat |
|
This ad is part of our Revenue Sharing program |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| setTimeout in loop (newbie) | dbworm | JavaScript & AJAX Forum | 4 | 12-12-2006 09:05 AM |