Language neutral "Dynamic Connector" in Visio-vba
I have a VBA macro that draws dynamic Connectors. The connector master is instiantated like this:
dim flowChartStencils as visio.document
set flowChartStencils = documents.openEx(templatePath, 0)
dim connectorMaster as visio.master
set connectorMaster = flowChartStencils.masters(dynamicConnectorName)
The problem I am facing is th开发者_StackOverflowat both the templatePath
and the dynamicConnectorName
seems to be dependant on the language of the visio installation. So, further up in the code, I have a:
' const templatePath = "C:\Programme\Microsoft Office\Visio10\1031\Solutions\Flowchart\Basic Flowchart Shapes (US units).vss"
const templatePath = "c:\Program Files\Microsoft Office\Visio10\1031\Lösungen\Flussdiagramm\Grundlegende Flussdiagramm-Shapes.VSS"
and a
' const dynamicConnectorName = "Dynamic Connector"
const dynamicConnectorName = "Dynamischer Verbinder"
both of which i comment and un-comment according to the language of the installation.
Since I want to port the vba code to different installations, I was wondering if there is an easier way or even what the easiest way is to do it.
What about:
If Application.Language = "English" Then
const dynamicConnectorName = "Dynamic Connector"
Elseif Application.Language = "German" Then
const dynamicConnectorName = "Dynamischer Verbinder"
End If
精彩评论