I'm using Access and Word 2010. My client wants me to create a multilingual Ribbon Bar which, at the click of one of the controls, it changes the labels, tips, etc to the selected language.
As you might already know, the XML behing the Ribbon UI has a series of controls with an ID. There are also fields for labels, etc. So the theory is that, as the language choice is changed, the XML calls back a procedure in Word VBA which in turn, reads an Access database for the correct label based on the ID of the control in the Ribbon XML (phew!)
I've created the database with five fields: One has the names of the controls in the XML whilst the other four have the appropriate translated labels for each language required.
I'm creating the building blocks little by little just to get the theory correct and have the following procedure in a word module:
It compiles OK but when I run it I get "Run time error 2950 - Reserved Error" on the line highlighted in red above.
Searching high and low in every forum I could find does not give me a result in spite of all the good examples of coding I have applied from helpful members.
I believe I have all the correct References set up in Tools>References in the VBE.
In theory, what I'm trying to achieve seems very simple, but it sure is giving me a headache in this instance!
Can anyone offer any suggestions as to the correct steps, please?
As you might already know, the XML behing the Ribbon UI has a series of controls with an ID. There are also fields for labels, etc. So the theory is that, as the language choice is changed, the XML calls back a procedure in Word VBA which in turn, reads an Access database for the correct label based on the ID of the control in the Ribbon XML (phew!)
I've created the database with five fields: One has the names of the controls in the XML whilst the other four have the appropriate translated labels for each language required.
I'm creating the building blocks little by little just to get the theory correct and have the following procedure in a word module:
Code:
Sub UsingDAOWithWord()
Dim dbRibbonData As DAO.Database
Dim myString As Variant
Set dbRibbonData = OpenDatabase _
(Name:="D:\MyDATA\MyClient\RibbonX Project\" _
& "RibbonData.accdb")
[B][COLOR=Red]myString = Access.Application.DLookup("English", "Language_Labels", "Field_Code = 'rxmnuLanguages'")[/COLOR][/B]
MsgBox ("The result is: " & myString)
dbRibbonData.Close
End Sub
It compiles OK but when I run it I get "Run time error 2950 - Reserved Error" on the line highlighted in red above.
Searching high and low in every forum I could find does not give me a result in spite of all the good examples of coding I have applied from helpful members.
I believe I have all the correct References set up in Tools>References in the VBE.
In theory, what I'm trying to achieve seems very simple, but it sure is giving me a headache in this instance!
Can anyone offer any suggestions as to the correct steps, please?