Author Topic: Using the camera in Visio  (Read 2591 times)

0 Members and 1 Guest are viewing this topic.

tomp377

  • Newbie
  • *
  • Posts: 1
Using the camera in Visio
« on: June 23, 2016, 06:05:43 AM »
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

  • Full Member
  • ***
  • Posts: 218
  • Just This Guy
    • The Pennsylvania Project, with Ken Krawchuk
Re: Using the camera in Visio
« Reply #1 on: June 23, 2016, 12:08:01 PM »
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.

Code

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
'caster

The Pennsylvania Project
Radio Podcast

10 to 11 AM Saturdays on WWDB 860 AM in Philadelphia
7 to 8 AM Mondays on KUR 1670 AM in Kutztown
On demand at http://PennsylvaniaProject.com

jfvert

  • Jr. Member
  • **
  • Posts: 35
Re: Using the camera in Visio
« Reply #2 on: July 08, 2016, 01:39:37 PM »
Thanks same prob here