F
Fred Goldman
Something that should be so simple and it's driving me nuts! I can't find any
kind of documentation.
I have this VBA code that simply adds two character styles and then does two
replacements. I need to get this into VBScript syntax and on every line I am
getting errors, or it is simply doing nothing. Does anyone know how to
translate this, I would be very thankful.
Set Word = CreateObject("Word.Application")
Word.Visible = True
Word.Documents.Open ("c:\Siman35.doc")
On Error Resume Next
Word.ActiveDocument.Styles.Add "Hebrew", Type:=wdStyleTypeCharacter
On Error Resume Next
Word.ActiveDocument.Styles.Add Name = "Hebrew Bold",
Type:=wdStyleTypeCharacter
Word.Selection.Find.ClearFormatting
Word.Selection.Find.Replacement.ClearFormatting
Word.Selection.Find.Format = True
Word.Selection.Find.Font.Bold = True
Word.Selection.Find.Wrap = wdFindContinue
Word.Selection.Find.Format = True
Word.Selection.Find.Replacement.Style = ActiveDocument.Styles("Hebrew
Bold")
Word.Selection.Find.Execute Replace:=wdReplaceAll
Word.Selection.Find.ClearFormatting
Word.Selection.Find.Replacement.ClearFormatting
Word.Selection.Find.Font.Bold = False
Word.Selection.Find.Forward = True
Word.Selection.Find.Wrap = wdFindContinue
Word.Selection.Find.Format = True
Word.Selection.Find.LanguageID = wdHebrew
Word.Selection.Find.Replacement.Style = ActiveDocument.Styles("Hebrew")
Word.Selection.Find.Execute Replace:=wdReplaceAll
kind of documentation.
I have this VBA code that simply adds two character styles and then does two
replacements. I need to get this into VBScript syntax and on every line I am
getting errors, or it is simply doing nothing. Does anyone know how to
translate this, I would be very thankful.
Set Word = CreateObject("Word.Application")
Word.Visible = True
Word.Documents.Open ("c:\Siman35.doc")
On Error Resume Next
Word.ActiveDocument.Styles.Add "Hebrew", Type:=wdStyleTypeCharacter
On Error Resume Next
Word.ActiveDocument.Styles.Add Name = "Hebrew Bold",
Type:=wdStyleTypeCharacter
Word.Selection.Find.ClearFormatting
Word.Selection.Find.Replacement.ClearFormatting
Word.Selection.Find.Format = True
Word.Selection.Find.Font.Bold = True
Word.Selection.Find.Wrap = wdFindContinue
Word.Selection.Find.Format = True
Word.Selection.Find.Replacement.Style = ActiveDocument.Styles("Hebrew
Bold")
Word.Selection.Find.Execute Replace:=wdReplaceAll
Word.Selection.Find.ClearFormatting
Word.Selection.Find.Replacement.ClearFormatting
Word.Selection.Find.Font.Bold = False
Word.Selection.Find.Forward = True
Word.Selection.Find.Wrap = wdFindContinue
Word.Selection.Find.Format = True
Word.Selection.Find.LanguageID = wdHebrew
Word.Selection.Find.Replacement.Style = ActiveDocument.Styles("Hebrew")
Word.Selection.Find.Execute Replace:=wdReplaceAll