OfficeIntegration.Word.Export(doc, "DetailTable", 2, False, ???Argument???, mappings)

Apr 21, 2014 at 6:28 AM
Hello,

I am trying to run the code bellow, everything works great except that the bookmarked table instead of being populated with strings it is populated with the text System.String
If i run through the list supplied as argument all values display correct, what am i doing wrong ?

Private Sub generatesss()
        Dim MyDocs = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
        Dim WordFile = MyDocs & "\An.docx"
        Dim FileName = MyDocs & "\An" & DateAndTime.Now.ToString("ddMMyyyyhhmmss") & ".docx"

        'Dim services As ProductGroupDetail
        Dim theVar As New List(Of String)
        Dim ieplm As IEnumerable(Of String) = theVar

        If File.Exists(WordFile) Then

            For Each detail As Product In Me.CRMOrderHeaders.SelectedItem.Products
                If detail.ProductGroup.ToString <> "Default" Then
                    For Each detaill As ProductGroupDetail In DataWorkspace.ApplicationData.ProductGroupDetails
                        If detaill.ProductGroup.ToString = detail.ProductGroup.ToString Then
                            theVar.Add(detaill.Descriere)
                        End If
                    Next
                End If
            Next

            Dim custFields As New List(Of OfficeIntegration.ColumnMapping)
            custFields.Add(New OfficeIntegration.ColumnMapping("Email", "Email"))

            Dim doc As Object = OfficeIntegration.Word.GenerateDocument(WordFile, Me.CRMOrderHeaders.SelectedItem, custFields)
_ _Dim mappings As New List(Of ColumnMapping)
            mappings.Add(New ColumnMapping("", "Descriere"))

            'ieplm was tested and displays correct values 

            OfficeIntegration.Word.Export(doc, "DetailTable", 2, False, ieplm, mappings)__

            Dim test = OfficeIntegration.Word.GetWord
            test.visible = False
            doc.saveas(FileName)
            doc.close(False)
            test.quit(False)

        End If
    End Sub