Call IE in PB

Source: Internet
Author: User

  1. Drag a Microsoft Web Browser in the window to adjust the size.
  2. View the properties, methods, and events supported by PB Object Browser. The main usage is as follows:
    1. Navigate (string url)
    2. ExecWB (n1_id, nCmdExecOpt, [pvaIn], [pvaOut])
  3. Next we will use the code to implement a program that opens a webpage, pops up another store, and then prints it directly.

Ole_1.object.Navigate (sle_1.text)

// The documentcomplete Event code of the Ole Control
Cb_saveas.postevent (clicked !)
We use post to save an event: clicked of the button, and call the Save IE function in the Save button.

// Save the clicked Event code of the button

Int OLECMDID_PRINT = 6
Int OLECMDID_PRINTPREVIEW = 7
Int OLECMDID_PAGESETUP = 8
Int OLECMDID_SAVEAS = 4

Int OLECMDEXECOPT_DODEFAULT = 0
Int OLECMDEXECOPT_PROMPTUSER = 1
Int OLECMDEXECOPT_DONTPROMPTUSER = 2

Try
Ole_1.object.ExecWB (OLECMDID_SaveAs, OLECMDEXECOPT_PROMPTUSER)
// Ole_1.object.ExecWB (OLECMDID_SaveAs, OLECMDEXECOPT_PROMPTUSER, AsStatement! ).

Ole_1.object.ExecWB (OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER)
// Ole_1.object.ExecWB (OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, AsStatement! ).
Catch (runtimeerror er)
// We usually do not display an error because an error occurs when the user clicks cancel.
// Messagebox ('', er. text)
End try

ExceWb detailed parameter description:

(A). n1_id
OLECMDID_OPEN = 1,
OLECMDID_NEW = 2,
OLECMDID_SAVE = 3,
OLECMDID_SAVEAS = 4,
OLECMDID_SAVECOPYAS = 5,
OLECMDID_PRINT = 6,
OLECMDID_PRINTPREVIEW = 7,
OLECMDID_PAGESETUP = 8,
OLECMDID_SPELL = 9,
OLECMDID_PROPERTIES = 10,
OLECMDID_CUT = 11,
OLECMDID_COPY = 12,
OLECMDID_PASTE = 13,
OLECMDID_PASTESPECIAL = 14,
OLECMDID_UNDO = 15,
OLECMDID_REDO = 16,
OLECMDID_SELECTALL = 17,
OLECMDID_CLEARSELECTION = 18,
OLECMDID_ZOOM = 19,
OLECMDID_GETZOOMRANGE = 20
OLECMDID_UPDATECOMMANDS = 21
OLECMDID_REFRESH = 22
OLECMDID_STOP = 23
OLECMDID_HIDETOOLBARS = 24
OLECMDID_SETPROGRESSMAX = 25
OLECMDID_SETPROGRESSPOS = 26
OLECMDID_SETPROGRESSTEXT = 27
OLECMDID_SETTITLE = 28
OLECMDID_SETDOWNLOADSTATE = 29
OLECMDID_STOPDOWNLOAD = 30
The above keywords can all be found in the menu of the browser. You can see it at a glance ﹗
(B). nCmdExecOpt
OLECMDEXECOPT_DODEFAULT = 0,
OLECMDEXECOPT_PROMPTUSER = 1,
LECMDEXECOPT_DONTPROMPTUSER = 2,
OLECMDEXECOPT_SHOWHELP = 3
For this parameter, select 1.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.