Copying characters from doc to VBA

P

Pawel

Hey,




I need to copy characters (including paragraph marks, etc.)
from Word document to VBA. Can I do that from macro? It
should be copied into string variable. I need to perform
some additional operations later on it.




Thanks,




Pawel
 
M

Mark Tangard

Hi Pawel,

Yes you can:

ActiveDocument.VBProject.VBComponents("ModuleNameHere"). _
CodeModule.AddFromString StringToBecomeTheCode

This can be pretty neat if your code is repetitive enough
to justify creating a lot of it in Word itself rather than
in the editor.
 

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