Insert a VB Created HTML Form into Word

Brief Overview:
==========

I have placed a customized menu item in MS Word 2000 that launches a VBA program that permits the user to make a selection from a list of HTML submission forms.  e.g., Contact Us, etc.

The user selects a specific form, and the VBA app calls a stubbed function in an ActiveX EXE automation server that creates the HTML form on-the-fly based on XML/DTD docs and returns the "raw" HTML code.

I then "smack" the HTML form into MS Word at the current cursor location using:

   Selection.InsertFile FileName

It work fine... It looks correct on the screen... EXCEPT...

Word arbitrarily inserts a </form> statement immediately after the first element (e.g., textbox).

Obviously, there must be a better approach than simply reading a file directly into Word.

Can anyone assist me in this regard?

Thanks in advance.

Robert Cezar


 
 

LVL 1
RobertCezarAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
NetminderConnect With a Mentor Commented:
PAQed - no points refunded (of 500)

Netminder
Site Admin
0
 
OHDev2004Commented:
can't you just paste the raw html code in a one-time
because sometimes word compiles the html code just like frontpage ,,
what happens if i'm understanding it right:
when you start to  smack :) the html form Word Reads every line of it ,, then when it finds <form> and a form object after it like a textbox or button it closes the Form tag ,, so i think the better way is to paste it as a whole text ,,

try it with the clipboard ,
hope i didn't mess it up more than it already is :) lol
0
 
RobertCezarAuthor Commented:
I will give it a shot and let you know.
0
 
RobertCezarAuthor Commented:
Well,

It kind-of-works!   I can successfully paste the form into the Word document as long as it's outside an existing table. If the application inserts the form <object> inside and existing table (since the FORM object being inserted has an outer table... naturally), I receive a Stack Overflow error.

Back to the drawing board!

Robert
0
 
JMoon5FTMCommented:
Sounds strange...are we sure your ActiveX EXE is generating good HTML?  Can you post the example form you're working with?
0
All Courses

From novice to tech pro — start learning today.