Converting Word-macros and VBA-Forms to VS 2005

S

Steffen Grellmann

Hi Newsgroup,

I'm starting to make me familiar with Visual Studio 2005 and Visual
Studio Tools for Office SE.

Is there a way of converting macros written in VBA for Word and
especially, forms designed with VBA for the use in Word? I'm afraid
the answer is now and I have to write them new?

I'm able to open my doc-files (that have forms and macro-code
included) in VSTO, but it seems that all my forms and macro code has
been removed and just the document shows up in VSTO.

Your time and help is highly appreciated.

Kind regards,

Steffen
 
C

Cindy M.

Hi Steffen,
I'm starting to make me familiar with Visual Studio 2005 and Visual
Studio Tools for Office SE.

Is there a way of converting macros written in VBA for Word and
especially, forms designed with VBA for the use in Word? I'm afraid
the answer is now and I have to write them new?
Basically, yes, that's correct. If you're moving to VB.NET you can
re-use a lot of the VBA that manipulates Word, you'll just have to
make some adjustments here and there. For example, if you have
something like this:

myRange.MoveEnd wdCharacter, -1

you'll need to fully qualify the enumeration:

myRange.MoveEnd(Word.WdUnits.wdCharacter, -1)
I'm able to open my doc-files (that have forms and macro-code
included) in VSTO, but it seems that all my forms and macro code has
been removed and just the document shows up in VSTO.
It's all still there, you just don't have any access to the VBA Editor
so that you can see it. You should still be able to call a public Sub
using Application.Run "Macroname", for example.

It would probably be a good idea to use the File/Export command in the
Word VBA Editor to make *.bas back-up copies of your code. These are
plain text files that you can read in Notepad, Wordpad or Word and
print out.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top