07-01-22 02:26 PM
Answered! Go to Answer.
10-01-22 08:51 AM
Dim doc as Object = GetDocument(handle,documentname)
doc.Tables.Item(TableNumber).Tables.Item(InnerTableNumber).Cell(celly,cellx).Range.Text = CellValue
Test Results:
I created somewhat a similar structure of document as you showed above where in my case, the outer table has only one column and the inner table has three columns (this might differ in your case that you would need to check):
The workflow that I have used can be divided into two parts, one where I am assigning values to outer table elements and one where I am assigning values for inner table elements indicated by two separate blocks:
For updating outer table elements, I use pre-built 'Set Table Cell Value' action. Here since I have only one column in my table so I have to update the value along with the label (here, it is 'Address-'):
For updating the values of inner table elements, I am using the custom action 'Set Inner Table Cell Value' that we built:
Upon running the workflow, the output that I am getting is as follows:
Let us know if this helps to resolve your query!
07-01-22 05:39 PM
Dim doc as Object = GetDocument(handle,documentname)
doc.Tables.Item(TableNumber).Cell(celly,cellx).Range.Text = CellValue
To support a nested table, you would want to change the above code to look something like this:
Dim doc as Object = GetDocument(handle,documentname)
doc.Tables(TableNumber).Tables.Item(NestedTableNumber).Cell(celly,cellx).Range.Text = CellValue
Note that TableNumber will now represent the parent table. You will need to define a new input data item (named NestedTableNumber in the code above) that represents the nested table within the parent. That should be it for your specific use case.
Be aware that this change will only support nested tables one-level deep. In other words, if you had another table nested within a cell of the first nested table you would have to change the code to include one more depth of Tables(XXXX) reference. Does that make sense?
Cheers,
10-01-22 08:51 AM
Dim doc as Object = GetDocument(handle,documentname)
doc.Tables.Item(TableNumber).Tables.Item(InnerTableNumber).Cell(celly,cellx).Range.Text = CellValue
Test Results:
I created somewhat a similar structure of document as you showed above where in my case, the outer table has only one column and the inner table has three columns (this might differ in your case that you would need to check):
The workflow that I have used can be divided into two parts, one where I am assigning values to outer table elements and one where I am assigning values for inner table elements indicated by two separate blocks:
For updating outer table elements, I use pre-built 'Set Table Cell Value' action. Here since I have only one column in my table so I have to update the value along with the label (here, it is 'Address-'):
For updating the values of inner table elements, I am using the custom action 'Set Inner Table Cell Value' that we built:
Upon running the workflow, the output that I am getting is as follows:
Let us know if this helps to resolve your query!
11-01-22 08:55 AM
11-01-22 10:09 AM
11-01-22 10:30 AM
11-01-22 11:06 AM
11-01-22 11:32 AM
11-01-22 12:40 PM
11-01-22 02:43 PM
Dim found As Boolean
Dim d As Object = GetDocument(handle,document_name)
Dim w As Object = d.Application
Dim s As Object = w.Selection
Dim f As Object = s.Find
Try
f.ClearFormatting
With f
.Text = Text
.Replacement.Text = ""
.Forward = True
.Wrap = 1 'wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
found = f.Execute
If make_bold = True Then
s.Font.Bold = True
Else
s.Font.Bold = False
End If
If make_italic = True Then
s.Font.Italic = True
Else
s.Font.Italic = False
End If
If make_underlined = True Then
s.Font.Underline = True
Else
s.Font.Underline = False
End If
Finally
d = Nothing
w = Nothing
s = Nothing
f = Nothing
End try