Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Web Browser Control
Message
From
14/12/2004 09:26:15
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00969064
Message ID:
00969079
Views:
40
We are not using the builtin toolbar. Instead we display our own. I want to get it working because we will using the same thing to print whatever is displayed in the activex control (which may not be a pdf in the future but maybe a webpage or xml document).

I have found some information on doing it in Delphi that I am trying to translate to VfP:

UPDATE:

I think it might be:
thisform.webcontrol.ExecWb(6,0,0,0)
The control has a method execwb():

// constants useful when printing
SHDocVw.OLECMDID Print = SHDocVw.OLECMDID.OLECMDID_PRINT;
// use this value to print without prompting
// SHDocVw.OLECMDEXECOPT PromptUser =
// SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_PROMPTUSER;
SHDocVw.OLECMDEXECOPT DontPromptUser =
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER;

if (!IsPrinterEnabled() ) return;
// print without prompting user
axWebBrowser1.ExecWB(Print, DontPromptUser, ref o, ref o);
// to prompt the user with printer settings
// axWebBrowser1.ExecWB(Print, PromptUser, ref o, ref o);
}

ExecWB( OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER );

type
OLECMDID = TOleEnum;
const
OLECMDID_OPEN = $00000001;
OLECMDID_NEW = $00000002;
OLECMDID_SAVE = $00000003;
OLECMDID_SAVEAS = $00000004;
OLECMDID_SAVECOPYAS = $00000005;
OLECMDID_PRINT = $00000006;
OLECMDID_PRINTPREVIEW = $00000007;
OLECMDID_PAGESETUP = $00000008;
OLECMDID_SPELL = $00000009;
OLECMDID_PROPERTIES = $0000000A;
OLECMDID_CUT = $0000000B;
OLECMDID_COPY = $0000000C;
OLECMDID_PASTE = $0000000D;
OLECMDID_PASTESPECIAL = $0000000E;
OLECMDID_UNDO = $0000000F;
OLECMDID_REDO = $00000010;
OLECMDID_SELECTALL = $00000011;
OLECMDID_CLEARSELECTION = $00000012;
OLECMDID_ZOOM = $00000013;
OLECMDID_GETZOOMRANGE = $00000014;
OLECMDID_UPDATECOMMANDS = $00000015;
OLECMDID_REFRESH = $00000016;
OLECMDID_STOP = $00000017;
OLECMDID_HIDETOOLBARS = $00000018;
OLECMDID_SETPROGRESSMAX = $00000019;
OLECMDID_SETPROGRESSPOS = $0000001A;
OLECMDID_SETPROGRESSTEXT = $0000001B;
OLECMDID_SETTITLE = $0000001C;
OLECMDID_SETDOWNLOADSTATE = $0000001D;
OLECMDID_STOPDOWNLOAD = $0000001E;
OLECMDID_ONTOOLBARACTIVATED = $0000001F;
OLECMDID_FIND = $00000020;
OLECMDID_DELETE = $00000021;
OLECMDID_HTTPEQUIV = $00000022;
OLECMDID_HTTPEQUIV_DONE = $00000023;
OLECMDID_ENABLE_INTERACTION = $00000024;
OLECMDID_ONUNLOAD = $00000025;
OLECMDID_PROPERTYBAG2 = $00000026;
OLECMDID_PREREFRESH = $00000027;
OLECMDID_SHOWSCRIPTERROR = $00000028;
OLECMDID_SHOWMESSAGE = $00000029;
OLECMDID_SHOWFIND = $0000002A;
OLECMDID_SHOWPAGESETUP = $0000002B;
OLECMDID_SHOWPRINT = $0000002C;
OLECMDID_CLOSE = $0000002D;
OLECMDID_ALLOWUILESSSAVEAS = $0000002E;
OLECMDID_DONTDOWNLOADCSS = $0000002F;

// OLECMDF constants
type
OLECMDF = TOleEnum;
const
OLECMDF_SUPPORTED = $00000001;
OLECMDF_ENABLED = $00000002;
OLECMDF_LATCHED = $00000004;
OLECMDF_NINCHED = $00000008;
OLECMDF_INVISIBLE = $00000010;
OLECMDF_DEFHIDEONCTXTMENU = $00000020;

// OLECMDEXECOPT constants
type
OLECMDEXECOPT = TOleEnum;
const
OLECMDEXECOPT_DODEFAULT = $00000000;
OLECMDEXECOPT_PROMPTUSER = $00000001;
OLECMDEXECOPT_DONTPROMPTUSER = $00000002;
OLECMDEXECOPT_SHOWHELP = $00000003;

// tagREADYSTATE constants
type
tagREADYSTATE = TOleEnum;
const
READYSTATE_UNINITIALIZED = $00000000;
READYSTATE_LOADING = $00000001;
READYSTATE_LOADED = $00000002;
READYSTATE_INTERACTIVE = $00000003;
READYSTATE_COMPLETE = $00000004;
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform