Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Invoke IE's "Send to OneNote" from VBScript

136 views
Skip to first unread message

serg.t...@gmail.com

unread,
May 16, 2013, 9:51:20 PM5/16/13
to
Hi All,

I have IE10 & OneNote 2013 installed on my PC. OneNote has "Send to OneNote" item added to IE menu. I'm creating IE application object and opening a web page in VBScript like this:
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate targetURL

Now when the page is opened I'd like to send it to OneNote app (if doing that manually one just clicks 'Send to OneNote' menu item). Please advise how to do that from VBScript. execWB works straightforward for the standard commands but it's unclear in case of extensions. Sending to OneNote printer option doesn't work for my task (because content is captured as image and split into pages).

Thanks!

Mayayana

unread,
May 17, 2013, 9:26:54 AM5/17/13
to
Are we supposed to know what "OneNote" is? For
any program the issue is probably the same, but if
OneNote is from Microsoft there could be a custom
tie-in.
Three things I can think of:

1) Use Sendkeys to automate
the menu click. But that's a bit hokey and I'm not sure
whether it still works in later Windows versions. I seem
to remember that MS partially broke it for security
reasons.

2) If you can find out the action taken you might
be able to do it directly. For instance, if the IE menu
just runs OneNote with a command line string
consisting of the URL then you might be able to
do something with WScript.Shell, like:

SH.Run OneNote-exe-path URL

3) If OneNote is from MS the menu might be hard-coded.
If not then there's probably a Registry method for adding
custom IE SendTo items. In that case you might be able
to do the operation directly based on information found
in those settings.

In any case, I don't know of any generic menu-click
operation in the ExecWB commands.

----------------------------------------

serg.t...@gmail.com

unread,
May 17, 2013, 4:27:17 PM5/17/13
to
Thanks Mayayana,

OneNote is a part of MSOffice, tool for note taking (like Evernote).

- SendKeys doesn't work
- menu command is bound to dll, not executable file, parameters are unclear. One could possible dig thru to find out dll interface, but is it possible to invoke arbitrary dll from VBScript?


пятница, 17 мая 2013 г., 9:26:54 UTC-4 пользователь Mayayana написал:

Mayayana

unread,
May 17, 2013, 5:50:31 PM5/17/13
to

| - menu command is bound to dll, not executable file,
| parameters are unclear. One could possible dig thru
| to find out dll interface, but is it possible to invoke
| arbitrary dll from VBScript?

Only a COM DLL with a dispatch interface. You can't
call Windows APIs, but if there's a COM dispatch interface
for late bonding (CreateObject) you can use it.


Mayayana

unread,
May 17, 2013, 11:43:16 PM5/17/13
to

| Only a COM DLL with a dispatch interface. You can't
| call Windows APIs, but if there's a COM dispatch interface
| for late bonding (CreateObject) you can use it.
|

Woops. That should read "late binding".

I got curious and started looking around, as I've
never heard of custom SendTo in IE. I found the
download:
http://www.microsoft.com/en-us/download/details.aspx?id=264

It's an SFX CAB file conatinaing an MSI. Unpacking
the MSI I found that the DLLs inside are all .Net DLLs.
That almost certainly rules out any kind of script access.
The Registry settings it adds are .Net "pseudo-COM".
There's no sign of any ProgID setting. (Needed for
CreateObject.) There are some interesting ExecWB-
related values, though. A sampling:

HKCR\Record\{2749BADE-53DF-3CC8-A984-0F05C3AE6E21}\1.0.2.0\Class.IE2OneNote.OLECMDEXECOPT.SZ
HKCR\Record\{CCF6FD18-B6AE-39BB-AA3F-0CF2DD858B76}\1.0.2.0\Assembly.IE2OneNote,
Version=1.0.2.0, Culture=neutral, PublicKeyToken=43b04a484ffb9268.SZ
HKCR\Record\{CCF6FD18-B6AE-39BB-AA3F-0CF2DD858B76}\1.0.2.0\Class.IE2OneNote.OLECMDF.SZ
HKCR\Record\{29EA4D85-0766-3293-B5F7-C2CE9390F5FA}\1.0.2.0\Class.IE2OneNote.OLECMDTEXT.SZ

I don't understand how .Net "pseudo-COM" listings
work. It does appear that there may be an ExecWB
OLECMDID set up for OneNote, but I don't find anything
about it online.


0 new messages