Jump to content
KickStarter15

Covert VB code to Autoit code

Recommended Posts

KickStarter15

Hi Experts,

I just need your help guys in converting this VBA code to Autoit. Not really good in doing the conversion.:sweating:

This is to find superscript letters or numbers in Word document.

Selection.Find.ClearFormatting
    With Selection.Find.Font
        .Superscript = True
        .Subscript = False
    End With
    Selection.Find.Execute
    With Selection.Find
        .Text = ""
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Application.Browser.Next

Having hard time nowadays with my projects.:'(

Grateful and Appreciated if anyone could help me with this.

 

Thanks in advance, Experts.^_^

KS15

 

Edited by KickStarter15
Edited: Removed Item 2 already fixed by Subz.

Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare.

Share this post


Link to post
Share on other sites
Quesney

Not sure if the info in this post will help you or not, but @water assisted someone here with some ideas.


“Courage is being scared to death, but saddling up anyway”John Wayne

Share this post


Link to post
Share on other sites
Juvigy

Here you go:

#include <Word.au3>

$oWord = _Word_Create()
$oDoc = _Word_DocAttach($oWord, "SC preparation.docx", "Filename")

$oWord.Selection.Find.ClearFormatting
    With $oWord.Selection.Find.Font
        .Superscript = True
        .Subscript = False
    EndWith
    $oWord.Selection.Find.Execute
    With $oWord.Selection.Find
        .Text = ""
        .Replacement.Text = ""
        .Forward = True
        .Wrap = $wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    EndWith
    $oWord.Application.Browser.Next

 

Share this post


Link to post
Share on other sites
KickStarter15

@Quesney, Thanks, man. Appreciated, got the idea.^_^

@Juvigy, I don't know that simple is how to convert such VB I posted. Thanks a lot, I'm new in Word UDF so might ask more in the future.:sweating:

 

Thank you Guys, for the time.

 

KS15

 

 


Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×