DPrometheus
Well-known member
Hey there,
Some serious problem occurred the other day.
Im building a reporting module. At the moment I have a .NET Application which consists of several buttons to the right side of the form. on the mid - left side there is Word 2007 hosted in a panel. The .NET Application loads a .NET DLL for some functionality for those buttons. Word loads a specific template which strips most of the ribbon and adds our own buttons and controls. (With VBA Scripts). These buttons calls the same .NET DLL as the application. Now I need to have access to a patient Identifier (for now perhaps more fields later on) which resides in the .NET DLL.
I made a simple class EccPatientManager which holds the patient ID.
If I fill this in the .NET Application with valid data and call this from word (with vba ) I always get back -1. Probably because the .NET DLL is loaded twice, once for each process.
Now I looked a little into IPC but with DDE I think this is a no-go with my current knowledge about it and the time constraint on the project.
Also .NET solutions as .NET Remoting dont apply in my opinion as WinWord is not a .NET application, and I cant modify its source
Does someone can put me in the right direction to send data (as simple as integer value-types) from my application to the VBA script? I need to execute some code in VBA [create a form (from the .NET DLL) and show it, as well as supply the patient Identifier]. (No option to move the calling code to the .NET DLL as the VBA handles the GUI of the template for WinWord).
Thanks for reading, let me know if youve got any suggestions..
~ DP
Some serious problem occurred the other day.
Im building a reporting module. At the moment I have a .NET Application which consists of several buttons to the right side of the form. on the mid - left side there is Word 2007 hosted in a panel. The .NET Application loads a .NET DLL for some functionality for those buttons. Word loads a specific template which strips most of the ribbon and adds our own buttons and controls. (With VBA Scripts). These buttons calls the same .NET DLL as the application. Now I need to have access to a patient Identifier (for now perhaps more fields later on) which resides in the .NET DLL.
I made a simple class EccPatientManager which holds the patient ID.
Code:
Public Class EccPatientManager
Shared ID
private shared _id As Long = -1
<summary>
Switch to patient
</summary>
<param name="value"></param>
<remarks></remarks>
Public Shared Sub setPatient(ByVal value As Long)
_id = value
End Sub
<summary>
Retrieve patient ID
</summary>
<value></value>
<returns></returns>
<remarks></remarks>
Public ReadOnly Property ID() As Long
Get
Return _id
End Get
End Property
If I fill this in the .NET Application with valid data and call this from word (with vba ) I always get back -1. Probably because the .NET DLL is loaded twice, once for each process.
Now I looked a little into IPC but with DDE I think this is a no-go with my current knowledge about it and the time constraint on the project.
Also .NET solutions as .NET Remoting dont apply in my opinion as WinWord is not a .NET application, and I cant modify its source
Does someone can put me in the right direction to send data (as simple as integer value-types) from my application to the VBA script? I need to execute some code in VBA [create a form (from the .NET DLL) and show it, as well as supply the patient Identifier]. (No option to move the calling code to the .NET DLL as the VBA handles the GUI of the template for WinWord).
Thanks for reading, let me know if youve got any suggestions..
~ DP