News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Using the camera in Visio

Started by tomp377, June 23, 2016, 11:05:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tomp377

Hi guys,

I just found a snippet of code for taking a photo with the webcam using microsoft Excel:

CommandBars.FindControl(ID:=1764).Execute

I'd very much like to use this in Visio, which we'll be using to take photos on tablets. I've searched the code, but can find nothing in the Vision msdn documentation:

https://msdn.microsoft.com/en-us/library/office/ff765940.aspx

or the object browser in commandbuttons. Has anyone done this before?  or is there perhaps a standard windows version i can call from the command line?

Hey Ken

Tom:

    You could cheat and use Excel VBA within Visio.  Just add a reference to the Excel Object Library via the VBA UI and have at it.



Sub SmileForTheCamera()

Dim ExcelApplication As Variant

On Error Resume Next
Set ExcelApplication = GetObject(, "excel.application")
If ExcelApplication Is Nothing Then
    Set ExcelApplication = CreateObject("excel.application")
    End If
On Error GoTo 0

ExcelApplication.CommandBars.FindControl(ID:=1764).Execute

End Sub



   Hope this helps,

   - Ken

Ken V. Krawchuk
Author
No Dogs on Mars - A Starship Story
http://astarshipstory.com

jfvert


Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 187 (show)
Files included: 40 - 1775KB. (show)
Memory used: 1293KB.
Tokens: post-login.
Cache hits: 13: 0.00161s for 26,766 bytes (show)
Cache misses: 2: (show)
Queries used: 15.

[Show Queries]