Solved

Access OLE Object Methods from IE Object

Posted on 2002-07-11
4
187 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA filters 2 51
Copy a row 12 58
Looking for VB6 code to read SQL table export it to ascii 8 32
VB 6 error 5 in windows 10 but not in XP 7 44
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

920 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

12 Experts available now in Live!

Get 1:1 Help Now