S
slaprade
I am using Word 2007, VSTO2005SE and Visual Studio VB to create a shared
addin automation app.
I have an "other" app that launches Word calling a particular Sub in my dotm
file
The dotm declares the addin like this "Public MCTai As New MCTClass07.Class07"
The dotm calls Class07 routines that load Class07 tables from SQL. This call
resides in the routine called by the "other" app
Subs executed from the dotm that display table.row.count show that these
tables have data
I have created Tabs in the Ribbon with some success using callbacks for
buttons to the .net code
The problem starts when I try to populate a dropDown with data from these
local tables
I can populate the dropDown with static data in the GetItemCount,
GetItemLabel and GetItemID functions
When I replace the static data with table information like GetItemLabel =
DV_APC.Item(X).Item(1).ToString, I get error messages NOT when Word starts
but when I try to select the dropDown. The error messages indicate there is
no data in DV_APC
When I put a MSGBOX for the table.row.count of a table in the GetItemLable
function, it displays 0 rows
The core of the dotm looks like this
Public WithEvents appWord As Word.Application
Public MCTai As New MCTClass07.Class07
Public Function MSGatewayInitialize(OdbcStr As String, LibName As String,
recordID As Long, docName As String, ByRef rcMsg As String) As Long
Dim returnCode As Long
returnCode = 0
Call Register_Event_Handler(OdbcStr) 'add event handler
On Error GoTo init_error
Call MCTai.InitDocument(ActiveDocument, OdbcStr, LibName, recordID)
Call Module1.KeepData(OdbcStr, LibName) 'this call will save data to
MCTai and load tables from SQL
On Error GoTo 0
MSGatewayInitialize = returnCode
Exit Function
init_error:
MsgBox (Err.Description) + vbCrLf + "Initialization error"
Err.Clear
returnCode = -1
End Function
So my question may be "What is the order of these parts loading"?
Or my question may be "how do I read SQL tables into the dropDowns of the
ribbon since I have to make the queries to SQL from my code"?
addin automation app.
I have an "other" app that launches Word calling a particular Sub in my dotm
file
The dotm declares the addin like this "Public MCTai As New MCTClass07.Class07"
The dotm calls Class07 routines that load Class07 tables from SQL. This call
resides in the routine called by the "other" app
Subs executed from the dotm that display table.row.count show that these
tables have data
I have created Tabs in the Ribbon with some success using callbacks for
buttons to the .net code
The problem starts when I try to populate a dropDown with data from these
local tables
I can populate the dropDown with static data in the GetItemCount,
GetItemLabel and GetItemID functions
When I replace the static data with table information like GetItemLabel =
DV_APC.Item(X).Item(1).ToString, I get error messages NOT when Word starts
but when I try to select the dropDown. The error messages indicate there is
no data in DV_APC
When I put a MSGBOX for the table.row.count of a table in the GetItemLable
function, it displays 0 rows
The core of the dotm looks like this
Public WithEvents appWord As Word.Application
Public MCTai As New MCTClass07.Class07
Public Function MSGatewayInitialize(OdbcStr As String, LibName As String,
recordID As Long, docName As String, ByRef rcMsg As String) As Long
Dim returnCode As Long
returnCode = 0
Call Register_Event_Handler(OdbcStr) 'add event handler
On Error GoTo init_error
Call MCTai.InitDocument(ActiveDocument, OdbcStr, LibName, recordID)
Call Module1.KeepData(OdbcStr, LibName) 'this call will save data to
MCTai and load tables from SQL
On Error GoTo 0
MSGatewayInitialize = returnCode
Exit Function
init_error:
MsgBox (Err.Description) + vbCrLf + "Initialization error"
Err.Clear
returnCode = -1
End Function
So my question may be "What is the order of these parts loading"?
Or my question may be "how do I read SQL tables into the dropDowns of the
ribbon since I have to make the queries to SQL from my code"?