How do I automate a Word object on a Frame?

T

Tweedie

I am trying to Display a Word document and some custom buttons on a single
web page. The idea is to allow the user to edit the document manually, then
press an HTML button to save it and to initiate some additional
functionality. The code below shows that I am using Frames, and displaying
the Word document in one frame, and the Buttons.html file in the other. I do
not want to use the Word save button, but I want to call the Word save method
from code in the Buttons.html page. I know that I can access html pages in a
frame from a different frame, but do not know how to access the Word document
(or more specifically - it's object model). The "msgbox
cstr(Parent.Frames(0).name)" code will return the name of the frame with the
word doc, so I have been trying to use the Parent.Frames(0) object to no
avail.

Ideally I want my Button2_click sub to invoke the "save" method on the Word
document.

Any help or pointers will be gratefully accepted (or an alternative way to
do this??).

Thanks,

Ken


+++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++
Code for main page
+++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++

<frameset rows="5*, *">
<frame name="WordDoc" src="WordDoc.doc">
<frame name="Buttons" src="buttons.html">
</frameset>

+++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++
Code for buttons.html
+++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++

<html>
<script LANGUAGE="VBScript">
<!--
Sub Button2_onclick
msgbox cstr(Parent.Frames(0).name)
'I want to save the word document here!!!
' and then continue on with other functions
End Sub
-->
</script>

<body>
<input id="Button2" type="button" value="Click Me To Save Word Doc"
name="Button2">
</body>
</html>
 
W

Wei-Dong XU [MSFT]

Hi Ken,

Thanks for posting at the newsgroup!

I have reviewed your thread. Currently I am finding somebody who could help
you on it. We will post back in the newsgroup as soon as possible.

If there is anything unclear, please feel free to post in the group and we
will follow up there

Best Regards,
Wei-Dong XU
Microsoft Product Support Services

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
Business-Critical Phone Support (BCPS) provides you with technical phone
support at no charge during critical LAN outages or "business down"
situations. This benefit is available 24 hours a day, 7 days a week to all
Microsoft technology partners in the United States and Canada.
This and other support options are available here:
BCPS:
https://partner.microsoft.com/US/technicalsupport/supportoverview/40010469
Others: https://partner.microsoft.com/US/technicalsupport/supportoverview/

If you are outside the United States, please visit our International
Support page:
http://support.microsoft.com/default.aspx?scid=/international.aspx.
=====================================================
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang [MSFT]

Hi,

Based on my test, after we open such a html page in webbrowser, the
frames(0).document will be a null point. I think it is hard to do that.
Also use IE as the word document container is for view purpose mainly.

Also if you open the word document in ie, you will find that the menu on
the IE will be changed. Can that be your workaround?

If you still have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang [MSFT]

Hi

Have you tried my suggestion? If you still have any concern, please feel
free to post here.
So far I am trying to contact our support team to see if there is any other
approach.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
T

Tweedie

Peter,

Thanks for your comments. I have not yet tried the suggested workaround yet.
If I can't control the save and close of Word, then my main problem is
identifying when a user has edited a document, and then closed it. I need to
know this so I can carry out some additional functions following the creation
of a new document. I have done this previously in VB6 by creating a Word
object with events, and trapping the Word Close event, but I don't see how I
can do this from a browser - even with vbscript? Any other suggestions?

Thanks again.

Ken
 
P

Peter Huang [MSFT]

Hi

It seems that it is hard to do the similar job with vbscript in the web
page with the VB6.
Based on my further research, I found a ActiveX control which can host
office document on webpage and expose the method to save a document.

Visual C++ ActiveX Control for hosting Office documents in Visual Basic or
HTML
http://support.microsoft.com/default.aspx?scid=kb;en-us;311765

You may have a try to see if that can not an alternative approach.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang [MSFT]

Hi Ken,

Have you tried the suggestion that use the DSOFramer control to workaround
the issue?

If you still have any concern on it, please feel free to post here.

Thanks!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
T

Tweedie

Thanks Peter - this is exaclty what I want to be able to do. I will explore
this control further. Time to brush up on my C++!

Thanks again.

Ken
 
P

Peter Huang [MSFT]

Hi Ken,

I am glad that my suggestion help you!


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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