I have an ASP.NET Webforms Application where the user can create reports with server-side office Automation. It basically works with FormFields that are being filled out and in the end the user gets a download with the Office document. The Application is quite old and I did not design this software. I'm also aware of the side effects of office server Automation and this article:
https://support.microsoft.com/en-us/help/257757/considerations-for-server-side-automation-of-office
It just works for almost 15 years with several different Office Versions, the newest one is Office 2016 but now I have to know if it still would work with Office 365. It looks like a hybrid solution, Software as a Service but still requires installation on the machine somehow.
It's a little bit hacky to set up like:
IIS Application User needs to take ownership of the following folder:
- C:\Programme(x86)\Microsoft Office
- C:\Programme\Microsoft Office
- C:\Windows\System32\config\systemprofile\AppData
- C:\Windows\System32\config\systemprofile\Desktop (sometimes missing so it needs to be created)
- C:\Windows\SysWOW64\config\systemprofile\AppData
- C:\Windows\SysWOW64\config\systemprofile\Desktop (sometimes missing so it needs to be created)
- C:\Programme(x86)\Microsoft.Net\
- C:\Program Files (x86)\Microsoft ASP.NET\
And in addition, some DCOM Configuration for Word and Excel needed. The IIS Application User needs permission to start the office application etc.
I'm not sure if all the requiered dependency are still there with office 365.
Here is a code snippet:
Function CreateDoc(ByVal docpath As String, ByVal docname As String, ByVal Document As String) As String
        Dim ff_name As String = ""
        Dim strFileName As String = Nothing
        Dim strExtension As String = Nothing
        Dim fileBytes As Byte() = Nothing
        Try
            Dim w = New Word.Application
            w.Visible = m_obj.Project.OfficeDisplay
            w.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone
            w.Documents.Open(docpath)
            SetRanges(Document)
            Dim i As Integer
            For Each ff As Word.FormField In w.ActiveDocument.FormFields
            .
            .
            .