convert VBA to VB

hi,

I am using VBA to use Microsoft Word functions of open/save file.

My code works perfectly.

But I found I have to open Microsoft Word in backend in order to run my code successfully.

I wonder if it is possible that I could translate this piece of VBA code to a standalone VB program so that I can run it without Microsoft Word

thanks,

Michael Ji 


Answer this question

convert VBA to VB

  • Vi Truong

    you basically need to create an object reference to MS Word from VB and then most if not all of your vba code will work through the reference!

  • Chanduu

    If you post the code, i'm sure most of us here can convert it.  I've never used any porting programs, i like to do my own conversions.  But there might be a program to port vba to vb, as they are really similar.

    Dustin.


  • pamskate5

    hi Dustin:

    Basically, I want to open a Word file and then do manipulation on it.

    Any hint you could give out

    thanks,

    Michael,

    -------------------------------------------------------------------

    Documents.Open FileName:=openFilePath, ConfirmConversions:=False, ReadOnly:= _
            False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:= _
            "", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="", _
            Format:=wdOpenFormatAuto

  • convert VBA to VB