In one of my process, I want to open the document and add a table with (1 row 1 column) and insert the audit log data. But while adding row I am getting an exception.
I create a blank document and call MS Word VBO --where I have created new page as -AddRowWithData and pass 3 parameters i.e handle,document Name and test to be entered as (22 Jun 2017 06:57:44 - The user admin manually marked an item with an exception). But I am getting exception as :
Internal : Could not execute code stage because exception thrown by code stage: Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH)).
Your help and suggestions will be appreciated. Please find attached document for more clarity.
Code for adding row :
Dim doc as Object = GetDocument(handle,documentname)
Dim w As Object = doc.Application
doc.Tables.Add(0,1, 1).Cell(1,1).Range.Text = TableData