Click here to Skip to main content
16,011,358 members
Home / Discussions / C#
   

C#

 
GeneralRe: AOP - Modifying a IMethodReturnMessage Pin
bzurer4-Dec-03 23:02
bzurer4-Dec-03 23:02 
GeneralUsing ::SendMessage in C# Pin
Andreas Philipson4-Dec-03 0:29
Andreas Philipson4-Dec-03 0:29 
GeneralRe: Using ::SendMessage in C# Pin
Heath Stewart4-Dec-03 5:04
protectorHeath Stewart4-Dec-03 5:04 
GeneralRe: Using ::SendMessage in C# Pin
Andreas Philipson4-Dec-03 5:18
Andreas Philipson4-Dec-03 5:18 
GeneralRe: Using ::SendMessage in C# Pin
Andreas Philipson4-Dec-03 5:23
Andreas Philipson4-Dec-03 5:23 
GeneralJournal Hook Pin
lajiyo3-Dec-03 22:18
lajiyo3-Dec-03 22:18 
GeneralHide Commandbars in word doc shown in axWebBrowser... Pin
Martin Jonsson3-Dec-03 20:02
Martin Jonsson3-Dec-03 20:02 
GeneralRe: Hide Commandbars in word doc shown in axWebBrowser... Pin
Heath Stewart4-Dec-03 4:53
protectorHeath Stewart4-Dec-03 4:53 
Both the WebBrowser control (and MSHTML that it hosts) and Word implement the IOleCommandTarget. This interface (or rather, its implementation) allows for command execution using simple strings (when used in automation) or command IDs. The WebBrowser control also has a custom set of command IDs, as well as MSHTML.

One of the standard command IDs, OLECMDID_HIDETOOLBARS, should be supported by Word. I'm not sure if IOleCommandTarget implementations MUST support the standards, but rest assured Office most likely does because the standard OLEDMCID enumerations were first defined by Office 95 (good indication that Office supports them still).

Now, because the WebBrowser control is an ActiveX container, getting its IOleCommandTarget interface (in .NET, querying for an interface is as simple as casting your object to said interface) and sending that command may just be enough. You'll either have to create an interop assumly with IOleCommandTarget and the various enumerations it uses, or create it yourself.

You can also send the command IDs (perhaps identified by their numbers, like OLECMDID_HIDETOOLBARS is defined as 24) through IWebBrowser2.ExecWB (IWebBrowser2 is the class interface for the WebBrowser control). I don't know if this will automatically be sent to the automation server (in this case, Word.Application) but - depending on how everything is sited - it's pretty likely and definitely worth a try. If not, you'll have to request the child object from the WebBrowser's site to get the Word doc in order to get the Word.Application, and cast to IOleCommandTarget to execute the command on it.

 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralC# Threads Pin
Anonymous3-Dec-03 19:35
Anonymous3-Dec-03 19:35 
GeneralRe: C# Threads Pin
Anonymous4-Dec-03 2:16
Anonymous4-Dec-03 2:16 
GeneralRe: C# Threads Pin
Heath Stewart4-Dec-03 4:40
protectorHeath Stewart4-Dec-03 4:40 
GeneralCopy files across networked servers Pin
stateyama3-Dec-03 14:11
stateyama3-Dec-03 14:11 
GeneralRe: Copy files across networked servers Pin
Heath Stewart4-Dec-03 4:37
protectorHeath Stewart4-Dec-03 4:37 
GeneralRe: Copy files across networked servers Pin
stateyama4-Dec-03 6:57
stateyama4-Dec-03 6:57 
GeneralTextBox Arrays Pin
spindar3-Dec-03 13:33
spindar3-Dec-03 13:33 
GeneralRe: TextBox Arrays Pin
Colin Angus Mackay3-Dec-03 15:03
Colin Angus Mackay3-Dec-03 15:03 
GeneralRe: TextBox Arrays Pin
Nick Seng3-Dec-03 15:40
Nick Seng3-Dec-03 15:40 
GeneralRe: TextBox Arrays Pin
Heath Stewart4-Dec-03 4:28
protectorHeath Stewart4-Dec-03 4:28 
GeneralWaiting for threads finish question Pin
clayne3-Dec-03 12:48
clayne3-Dec-03 12:48 
GeneralRe: Waiting for threads finish question Pin
Heath Stewart4-Dec-03 4:26
protectorHeath Stewart4-Dec-03 4:26 
GeneralRe: Waiting for threads finish question Pin
clayne4-Dec-03 8:37
clayne4-Dec-03 8:37 
QuestionHow to play audio files ? Pin
pahluwalia3-Dec-03 5:31
pahluwalia3-Dec-03 5:31 
AnswerRe: How to play audio files ? Pin
Heath Stewart3-Dec-03 6:29
protectorHeath Stewart3-Dec-03 6:29 
GeneralRichTextBox contents in a DB Pin
phimix3-Dec-03 5:19
phimix3-Dec-03 5:19 
GeneralRe: RichTextBox contents in a DB Pin
Heath Stewart3-Dec-03 6:27
protectorHeath Stewart3-Dec-03 6:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.