in reply to VBA Macro

Dears Monks, I want to process word through perl. How i can convert this vba macro to perl code (Microsoft VBScript Regular Expressions 5.5) Dim varRegex As New RegExp Dim varMatch As Match Dim varMatchs As MatchCollection varRegex.Global = True varRegex.MultiLine = False varRegex.IgnoreCase = True varRegex.Pattern = "^[^\d+]+" st = Selection.Start If varRegex.test(docrange.Text) = True Then Set varMatchs = varRegex.Execute(docrange.Text) For Each varMatch In varMatchs ActiveDocument.Range(st, st + Len(varMatch.Value)).Select Selection.Style = "authors" Next End If Thanks.

Replies are listed 'Best First'.
Re: VBA Macro
by talexb (Chancellor) on Jan 17, 2009 at 16:47 UTC

    For the benefit of those of us who aren't expert in VBA (such as myself), could you translate this into English? What are you trying to do? What code have you written so far?

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Re: VBA Macro
by missingthepoint (Friar) on Jan 18, 2009 at 05:09 UTC

    You might like to look into using Win32::OLE. The docs have an example for Excel at least....


    Life is denied by lack of attention,
    whether it be to cleaning windows
    or trying to write a masterpiece...
    -- Nadia Boulanger