Solved

Access OLE Object Methods from IE Object

Posted on 2002-07-11
4
182 Views
Last Modified: 2013-11-26
My VB application uses the "WebBrowser" Control.
I used the "Navigate" Method in order to Surf to a Word Document(.Doc). now I want (from my VB application) to create a button that access methods from the Word Object (for example, the print method).

Please don't send me workarounds, code samples will be appreciated.
0
Comment
Question by:avissar
4 Comments
 
LVL 6

Expert Comment

by:MELeBlanc
ID: 7145851
What other types of functions are you wanting to access?

For say printing, you can use the WebBrowser control's ExecWB command to do tasks such as printing...

WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DODEFAULT

0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 300 total points
ID: 7146518
Try this:
'set a reference to microsoft word x object library
option explicit

dim wdoc as word.document
' in Document_complete event of webbrowser paste this:
if (pdisp is webbrowser1.object)
   set wdoc= webbrowser1.document
   'example of how to access Word DOM:
   wdoc.PrintPreview
   ' and so on...
end if

Hope it helps
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8002332
Hi avissar,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept Richie_Simonetti's comment(s) as an answer.

avissar, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 8095332
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now