chetan Allipur

chetan Allipur

  • NA
  • 541
  • 168.8k

How to get the value by passing the string to method.

Jun 6 2017 8:33 AM
How to get the value by passing the string to method using word VSTO.
 
I have VBA Code here
 
Dim sTemp As String
sTemp = sGetDocVar("CTDPrefix")
 
method here
 
Function sGetDocVar(ByVal sVName As String) As String
On Error GoTo sGetDocVar_ERROR
sGetDocVar = ActiveDocument.Variables(sVName).Value
Exit Function
sGetDocVar_ERROR:
Select Case Err.Number
Case 5825 'Variable does not exist
sGetDocVar = vbNullString
Case Else
Const sProcedure As String = "sGetDocVar"
End Select
End Function
 
Please tell me in c# using word VSTO. Please anybody help me its urgent. 
 
 
 

Answers (1)