Google "Listen" button API code - text-to-speech

in Google Translate you can find a "listen" button that converts text to speech. I want to be able to use that button in my own site but I can't find the code in Google Translate API. I want to be able to listen whatever I write in a simple input field or text area. Thank you!

What language are you using?
This example is in vb:
Dim SAPI As Object
SAPI = CreateObject("SAPI.spvoice")
SAPI.Speak("ENTER YOUR TEXT HERE")
Now, depending on what OS the user has, different narrators will speak. If they are using XP then SAM(default) will speak. And I think the user can change to a different narrator. In Windows 7, a woman is the narrator, and can't be changed. I don't know about Vista though.
Hope this helps.

Related

vb Universal Windows Image Control

I am switching a vb.net form over to the Universal windows app format and have gotten stuck with switching the PictureBox control. The code in the form format is as follows.
Sub DisplayDie(die As PictureBox, face As Integer)
die.Image = Image.FromFile(FILE_PREFIX & face & FILE_SUFFIX)
End Sub
Well there are a lot of new concepts you will need to learn before to switch your code I think your code is from Windows Forms.
First of all there are somethings to know before:
You can't access directly to the folders of the user( C:/ or C:/MyFolder)
You need to enable some special capabilities to access to Documents library , Pictures library
https://msdn.microsoft.com/en-us/library/windows/apps/hh464936.aspx#special_capabilities
You need to use FileOpenPicker to let the user select some image
https://msdn.microsoft.com/library/windows/apps/br207847?cs-save-lang=1&cs-lang=vb#code-snippet-1
Finally you will get a stream.
Here is an example how to use it
http://www.c-sharpcorner.com/UploadFile/mahesh/open-file-using-fileopenpicker-in-windows-store-app/
this code is in C# but is very easy to understand.

Using VSTO to perform an action via selected e-mail text in Outlook

This should be pretty a pretty common scenario, but I have not found a solution yet.
I would like to highlight some text within the body of an e-mail and then click on something (context menu, toolbar button, etc) to perform a URL navigation using the selected text. For example, highlight the Fex Ex tracking number and then navigate to their web site using it as a query parameter (like "ww.fedextracking.com?packageid=12345").
How can you capture the selected text within an e-mail and then perform an action? I would greatly appreciate any suggestions or examples.
Thank you!
For Outlook 2007-2010 (or previous versions using WordMail), you can retrieve a Word object from the Inspector.WordEditor property. Then you can work with Word.Selection to access the selected text.
However, for Plain Text or Rich Text scenarios with Outlook 2000-2003, you have to use the SafeInspector object with Redemption (http://www.dimastr.com/redemption/) to access the selected text. I can't remember, but for HTML format messages with Outlook 2003-2003 you may be able to access the selected text with the IHTMLDocument object retrieved from SafeInspector.
I appreciate it's 588 days since you asked your question Loki70, but if somebody else Googles up this page (like I did, looking for how to create a selected text right-click context menu entry) then this may be an answer for you.
I have been using AutoHotKey, which works not just in Outlook, but everywhere in Windows, and have been writing utilities to Google the selected text, open an SSH session in PuTTY to the selected hostname, and similar.
If you don't mind running an extra application on your PC to capture the hotkey combination that you send, then this would do exactly what you're asking.
Here is my post on the AutoHotKey forum with a link to my code:
http://www.autohotkey.com/community/viewtopic.php?t=86402
It would be trivial to adapt this to do the FedEx query you've mentioned.
I hope this helps.

How to capture input from USB?

Searching found many answers along the lines of it depends on the device driver", but I don't think that it's that way here.
I have a cheap & nasty RFID tag reader. You just have to open notepad, touch a tag to the read and its serial number appears in notepad (I have not tried it in Linux).
Anyhoo, how can I programatically capture this serial number in VB.net (20088 express)?
Seem it work in keyboard emulation.
You can try to create a simple form with a textbox and check if the serial number appears on it when the tag is read and then manage the textbox events to retrive the info and set the focus correctly.
This probably works using keyboard emulation. The reader is pretending (to the PC) to be a USB keyboard, and simply sending the keystrokes.
If so you could do various things to check the keyboard input in VB.net. For a quick-and-dirty test, I would simply create a blank form with a textbox, make sure the textbox has focus, and read a tag. If the text passes to the textbox then the RFID reader is just passing keystrokes in, and you can use the textbox events to read the data (remembering to set focus to the textbox when you expect input).
If your app needs to do something more sophisticated with the input keystrokes, or you don't want them appearing in the control, you can trap and handle the keystrokes as they happen - the standard KB article on how to do this is here: http://support.microsoft.com/kb/320583

Making Textbox type into a textbox?

I'm a noob to VB.NET and I was wondering how to make something you type into a textbox on the application type that text into a website textbox and submit whats in the textbox by pressing a button? I am using visual studio 2008.
That is a little tricky to do, but it is possible. However, without more details on the specific browser or what you are trying to copy over, you aren't going to get a lot of answers on here.
Better Suggestion: Have you considered instead of trying to control the browser via "voodoo", that you might just have your VB.NET application submit the form/request directly to the web server and cut out the middle-man (the browser)?
I'm assuming you're trying to POST data to a web form from some other application. Check this out; it's in C# but you can translate it to VB.NET. It uses a WebBrowser control and the SetAttribute method to set input values on the web form.
// C#
WebBrowser browser;
...
browser.Document.GetElementById("username").SetAttribute("value", "MyUsername");
...
form.InvokeMember("submit");

Capture right-click'd text on Outlook Message Content

I'd like to know if it's possible to capture the text when a user right-click's on an Outlook message, and then add items to the right-click menu depending on the type of text.
This is an example of what I'd like to do. If there's a message (mail item) with the following content: "Hello, please call me at 555-8474 regarding item A1234" and the user right-click's on the number "8", the pop-up context menu will have an extra item at the bottom called "Call 555-8474", and a "PhoneCall" sub will be run if selected. If the user right-click's anywhere on "A1234" a different item (i.e. "Look up A1234") will be shown.
We're running Outlook 2003 and if possible I'd like to know if this can be done using VBA. I'm open to other ideas as well. Thanks!
You can use this example in VBA to get started
SmartTags is an Office 2003 feature that was designed for exactly this sort of thing. I honestly don't know SmartTags well enough to do more than wave in the general direction, so I hope you get a better answer from a domain expert....