AOB
Registered User.
- Local time
- Today, 06:46
- Joined
- Sep 26, 2012
- Messages
- 621
Hi all,
I'm trying to collaborate data on a daily basis from multiple sources across multiple regions with no network/server common to all participants. The plan is to distribute a daily dashboard based on the collected responses and monitor trends etc. I'd like to automate this as much as possible so that there is minimal work required from whoever has to co-ordinate all of this once it is up and running...
To achieve this, I intend to create a number of InfoPath form templates and store them on a SharePoint site to which each participant will have access. Each user will populate their respective forms each day and submit them (which sends the completed form to a central e-mail address)
My hope then is to create an Access database which pulls the data from each of the submitted forms within the appropriate Outlook folder, adds the appropriate records to the database and - eventually - generates some kind of dashboard of metrics.
I'm at the stage where I have one 'test' form template published to the SharePoint and can successfully complete and submit data which is routed to the appropriate inbox / folder.
I was hoping it would be relatively straightforward to programmatically import the data contained within each .xml file but it appears to be more troublesome than I thought. So I'm trying the VBA route...
I have a subroutine written which can identify the inbox / folder, loop through each of the mails / attachments and save them to a local drive (ideally, I would streamline the process by taking the data directly from the attachment rather than saving it first, but just want to get it working for now and improve it later...)
Now I'm working on a second sub to import the data from each saved .xml file. The only way I can see (which I know will not be sufficient) is the following :
(Not overly fond of this either, as I'd rather not have to actually open the file, merely refer to it) This method at least provides me with a single string (stFormInfo) containing the concatenated field values, although it is not delimited, making it difficult to parse the string into its constituent fields. And I can't assume a space to be a delimiter as some of the fields are free-format text and therefore will have spaces within them.
Can anybody provide some guidance on how to identify/extract individual fields/controls in the .xml file, and their associated values, from which I could then proceed to write the code to add them to the various tables?
Apologies for the long-windedness, just thought a little background would be no harm... And thanks in advance to anyone who can point me in a direction!
AOB
I'm trying to collaborate data on a daily basis from multiple sources across multiple regions with no network/server common to all participants. The plan is to distribute a daily dashboard based on the collected responses and monitor trends etc. I'd like to automate this as much as possible so that there is minimal work required from whoever has to co-ordinate all of this once it is up and running...
To achieve this, I intend to create a number of InfoPath form templates and store them on a SharePoint site to which each participant will have access. Each user will populate their respective forms each day and submit them (which sends the completed form to a central e-mail address)
My hope then is to create an Access database which pulls the data from each of the submitted forms within the appropriate Outlook folder, adds the appropriate records to the database and - eventually - generates some kind of dashboard of metrics.
I'm at the stage where I have one 'test' form template published to the SharePoint and can successfully complete and submit data which is routed to the appropriate inbox / folder.
I was hoping it would be relatively straightforward to programmatically import the data contained within each .xml file but it appears to be more troublesome than I thought. So I'm trying the VBA route...
I have a subroutine written which can identify the inbox / folder, loop through each of the mails / attachments and save them to a local drive (ideally, I would streamline the process by taking the data directly from the attachment rather than saving it first, but just want to get it working for now and improve it later...)
Now I'm working on a second sub to import the data from each saved .xml file. The only way I can see (which I know will not be sufficient) is the following :
Code:
Sub OpenInfoPathForm(stFormPath As String)
Dim objIP As Object
Dim objIPForm As Object
Dim stFormInfo As String
Set objIP = CreateObject("InfoPath.Application")
Set objIPForm = objIP.XDocuments.Open(stFormPath)
stFormInfo = objIPForm.DOM.Text
objIP.XDocuments.Close (0)
Set objIP = Nothing
Set objIPForm = Nothing
End Sub
(Not overly fond of this either, as I'd rather not have to actually open the file, merely refer to it) This method at least provides me with a single string (stFormInfo) containing the concatenated field values, although it is not delimited, making it difficult to parse the string into its constituent fields. And I can't assume a space to be a delimiter as some of the fields are free-format text and therefore will have spaces within them.
Can anybody provide some guidance on how to identify/extract individual fields/controls in the .xml file, and their associated values, from which I could then proceed to write the code to add them to the various tables?
Apologies for the long-windedness, just thought a little background would be no harm... And thanks in advance to anyone who can point me in a direction!
AOB