Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Saving or sending my Form to a Sharepoint Site folder

Avatar

Former Community Member
I have a button on my form that sends the form as an PDF attachment to whoever I specify.



Im looking for a way to also send/submit the form and all the data that was filled out as a PDF and/or as a XML file to a folder on my sharepoint site. Does anyone know of any Javascript or function that I can use to do this? I am new to livecycle so any thoughts are help is greatly appreciated.
5 Replies

Avatar

Former Community Member
Forget about LiveCycle for a second ...how would I write the file to sharepaoint if I was in Windows Explorer?

Avatar

Former Community Member
Here is what I would do if using a Microsoft product. This code actually saves it a sharepoint site and then emails to whoever I specify and also a person that that is listed in the form. This code also gives me control of what name the form is saved under. In this case I am using parameters to determine the name of the file.



In my case I have to accomodate users who outlook and lotus notes so I also do this for those users but with different code for the email part. For that portion I actually have 2 buttons one for outlook users and another for lotus notes users.



Let me know your thoughts. Thanks Paul!



Sub Submit()



Dim strRecip As String

Dim strSaveLoc As String

Dim wb As Workbook

Set wb = ActiveWorkbook

strBranch = Range("E3").Value

strRecip = Range("E5").Value

strDate = Range("O6").Value

strDateShort = Range("O8").Value

strApproval = Range("").Value



buildSaveDest = "http://mysharepoint site/Submitted%20Forms/" & strBranch & "_" & strDate & ".xls" 'Build Save As dest

Application.ActiveWorkbook.SaveAs buildSaveDest 'Save current File to SharePoint



This saves it to the C drive temp folder so I can email it later.

ActiveWorkbook.SaveAs "C:\temp\" & strBranch & "_" & strDate & ".xls"



Set myOlApp = CreateObject("Outlook.Application")

Set myItem = myOlApp.CreateItem(olMailItem)



myItem.Display

myItem.To = strRecip

myItem.cc = "email1.com;" & "email2.com"

myItem.Subject = strBranch & "_" & strDateShort & " Info Memo"

myItem.Body = "The following loss event has been submitted for your approval. Please review and respond as necessary within 2 business days."

Set myAttachments = myItem.Attachments

myAttachments.Add "C:\temp\" & strBranch & "_" & strDate & ".xls"



AppActivate myItem

SendKeys ("%s")



'myItem.ReadReceiptRequested = True



AppActivate myItem

'Docmd.SetWarnings True

ActiveWorkbook.Close



End Sub

Avatar

Former Community Member
The above code was written for Excel. If in excel you can hit alt + F11 to get the VB window where you can post the code. Just in case you were not familliar.

Avatar

Former Community Member
The magic is in these lines of the code:



buildSaveDest = "http://mysharepoint site/Submitted%20Forms/" & strBranch & "_" & strDate & ".xls" 'Build Save As dest

Application.ActiveWorkbook.SaveAs buildSaveDest 'Save current File to SharePoint



It looks like there is an API that is being called from Excel (Application.ActiveWorkbook.SaveAs buildSaveDest) to actually save the file. We can only send the PDF as a post or an email. You woudl have to write an intermediary program to recieve the file and call the API to write it into SharePoint for you. Note that I am not a Sharepoint expert by any stretch.



Other ways you get there is if Sharepoint supports WebDav Folders or FTP protocol you could simply use those.

Avatar

Former Community Member
I realize this discussion is slightly out of date, but I've just come across it. My company, Cardinal Solutions, is a gold level Adobe service partner and we have a special "LiveCycle-SharePoint" connector that provides two way integration with the two products. If you are interested in discussing some of the functionality and some possible solutions, send me an email.



Thank you!



Ryan D. Lunka

Cardinal Solutions Group

rlunka@cardinalsolutions.com