Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
How to get the "value of the field from table box" in the macro coding.
Have a look on this example from APIGuide.qvw:
set TableBox = ActiveDocument.GetSheetObject( "TB01" )
CellRect = ActiveDocument.GetApplication().GetEmptyRect()
CellRect.Top = 0
CellRect.Left = 0
CellRect.Width = TableBox.GetColumnCount
CellRect.Height = TableBox.GetRowCount
set CellMatrix = TableBox.GetCells( CellRect )
for RowIter=CellRect.Top to CellRect.Height-1
for ColIter=CellRect.Left to CellRect.Width-1
msgbox(CellMatrix(RowIter)(ColIter).Text)
next
next
- Marcus
MARCUS
example if we have client as field in the table box and and it contains 10 different values of different clientname. then how you get the selected client in the macro.
client
xxx1
xxx2
xxx3
xxxx4
.
.
.
xxx10
suppose if i click the xxx10 and the same value has to be passed in the macro what is the coding?
//create a variable in UI like :
vClient=GetFieldSelections(Client)
//in macro
DIM vClient1
vClient1=ActiveDocument.GetVariable("vClient").GetContent.String
now your vClient1 is having selected client name (xxx10 )
Maybe it's easier to run directly through a field instead of using a tablebox:
set val=ActiveDocument.Fields("clientname").GetPossibleValues
for i=0 to val.Count-1
msgbox(val.Item(i).Text)
next
- Marcus