If I look inside of an MS Infopath XML file, the attachments appear to be some kind of binary code in ASCII stored between tags. I don't have the background to identify, so I'm unsure. This should be easy to produce with VBA I would think.
The code I'm using is below. In this case, I'm trying to get the text from an Excel file that I can embed. If you run that code, the error should be something about the arguments being of the wrong type. In this case, I'm referencing an Excel file, but it could be a number of things.
The code between the tags is something like: stu2zAQvBfIPwi8BhadFCiKwnIOSXNMA8QFeqWptUWYr5Lr1P77rqg4MQLHimoCzUWURHJmdpaPnVxtjC4eI
I don't know if this helps, but I don't know what to make of it.
Const adTypeBinary = 1Const adTypeText = 2
Const adModeReadWrite = 3
Sub RunThis()
bin2var "c:\documents\IYYMMCC Validation.xlsx"
End Sub
Function bin2var(filename As String) As String
Dim f As Integer
f = FreeFile()
Open filename For Binary Access Read Lock Write As #f
bin2var = Space(FileLen(filename))
Get #f, , bin2var
thestring = BytesToString(bin2var, CdoUS_ASCII)
Close #f
End Function
Function BytesToString(bytes, charset)
With CreateObject("ADODB.Stream")
.Mode = adModeReadWrite
.Type = adTypeBinary
.Open
.Write bytes
.Position = 0
.Type = adTypeText
.charset = charset
BytesToString = .ReadText
End With
End Function