changing word code to a VB object
Posted on 1998-09-14
i have a bunch of macros in Word 7.0 that i need to convert to a .dll via VB5. as an object i will then call these macros through a Word97 template. if i understand right i can pretty much copy the wordbasic code straight to the vb compiler and compile my code and make it a .dll (someone correct me if im wrong). then inside word i need to do code something like:
dim WordObj as object
set WordObj = createobject("MyProject.MyModule")
right now in the code of MySub all i have is:
public sub changeColor
selection.font.colorindex = wdblue
i compiled it as a .dll, i then registered it using regsvr32 My.dll, i went into the tools pull down menu in word then to references and i found my .dll, i set the reference check box to on.
when i try to run the macro set up to execute my code i get a runtime error 424 oject required.
i really need to solve this problem thenks to anyone that can help.