id="info"

Question

Locked

Can a MS Word template be converted to VB

By allouttr ·
Templates (macros programmed in VBA) can be used to automate MS Word documents with forms and combo-boxes, etc. Can the VBA code in such a template be transferred to a Visual Basic executable file and still perform the same functions as the template with Word.

John James

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Yes and no

by Slayer_ In reply to Can a MS Word template be ...

It can't be directly transferred because of the different libraries.

You can create a word application object and manipulate it, but you cannot easily have the word documents combo box call back to the VB's code.

Collapse -

Converting a Word Template to VB

by iphelion In reply to Can a MS Word template be ...

If you are using the DOCX format then you can use the Microsoft OpenXML API to generate word documents. There is also a nifty tool in the toolkit to allow you to open a word document and it will generate a C# source code class for you that will reproduce that document using the API calls, you can then go in and manipulate whatever you like inside the content.

Some useful links:-

DOWNLOAD THE API AND TOOLKIT HERE
http://www.microsoft.com/downloads/details.aspx?FamilyId=C6E744E5-36E9-45F5-8D8C-331DF206E0D0

OFFICE DEVELOPER CENTRE
http://msdn.microsoft.com/en-us/office/default.aspx


Hope this is helpful,
ANdy

http://www.iphelion.com

Collapse -

Reponse To Answer

by Mehul Bhai In reply to Converting a Word Templat ...

Zombie Alert!!! & SPAM???

Collapse -

Zombie Alert!!! & SPAM???

by Mehul Bhai In reply to Can a MS Word template be ...

Zombie Alert!!! & SPAM???

Back to Software Forum
5 total posts (Page 1 of 1)  

Software Forums