Embedding/automating MS Word 2000 - help! 
Author Message
 Embedding/automating MS Word 2000 - help!

Hiya,

I'm running into problems trying to embed Word into a web page. I've tried
using:

    <iframe src="document.doc"></iframe>

which loads a Word document into IE okay and displays MS Word 2000 in an
<iframe>. All very funky. However when scripting it with:

    <script type="text/VBScript">
        sub wordthing()
            set wordobj = GetObject (,"Word.Application")
            wordobj.activedocument.saveas filename:="c:\hello.doc"
            .
            .
        end sub
    </script>

it seems unreliable -- if a user also has a Word window open independant of
the browser, thus the script can end up controlling this "external" Word.

I've also tried using:

    <object name="objword" id="objword"
        classid="clsid:000209FF-0000-0000-C000-000000000046"
        height="500" width="600">
    </object>

in the <body> and then scripting it with:

    <script type="text/vbscript">
        sub wordthing ()
            document.all.objword.Documents.Add
            document.all.objword.activedocument.saveas filename:="c:\me.doc"
        end sub
   </script>

and I've totally failed to get this to do anything (including display a Word
window in the browser to start with).

What I'd like to do is open a blank word window (or load a word template)
within a web page, and then be able to save any changes made to the embedded
word document as HTML, which looking at the Word automation API should be
possible with SaveAs(). If it's possible to attach a toolbar to the window
(eg, the formatting toolbar) so much the better. It's just getting the Word
window in the page and then creating a script to reference the embedded word
I'm having trouble with.

I've spent far too long trying to get this working (a couple of weeks), so
any suggestions/hints/exmaple code welcome! Goggle, the MSDN and the rest of
the internet seem to have very little, if anything, about embedding word in
a HTML document. Plenty about VB, VC++ etc, but no HTML/VBScript/Javascript
examples. I'm sure I'm missing something obvious, but damned if I can see
what.

Any help appreciated,

Chris...
ps, before any suggests otherwise :) I've also asked this in
ms.public.word.vba.general and ms.public.word.oleinterop



Sun, 25 Jul 2004 00:57:52 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. TDBRadioGroup...Showing a dashed box around selected item?

2. blob prob

3. Help on scripting with MS Word 2000!?!

4. Automating email function within Word 2000 using Access 2000

5. MS PJ 2000 and MS Word via VBA

6. MS word 97 or 2000 pop up menus....help please

7. Automating MS Project 2000 through ASP and IIS

8. WaterMarks in MS Word 2000

9. Pascal and C++

10. automate merging data between word and access 2000

11. Adjusting an Embedded Excel Worksheet in Word 2000

12. Automating Word 2000

 

 
Powered by phpBB® Forum Software