R
R
rem20072015-09-11 10:04:45
Computer networks
rem2007, 2015-09-11 10:04:45

How to create a service to automatically change a word document?

I want to create a service in which the word document was changed by a macro when it was loaded (for example, the font became 16 and justified), and then it was given to the user for download already corrected. How to implement? asp.net?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Kovalsky, 2015-09-11
@dmitryKovalskiy

ASP.NET does not have tools for editing office documents built into the core. You can use any platform for which there is at least some plugin or library for editing .doc/.docx . I mean - any major platform.

E
Eugene, 2015-09-11
@yellowmew

Well, for example, you can do all the file processing in PowerShell (requires installed word\office) on the server where the service will run.
Change document: In the example, the entire font in the document (regardless of what was) is changed to the specified

PS C:\WINDOWS\system32> $WordApp = New-Object -ComObject word.application
PS C:\WINDOWS\system32> $WordApp.Visible = $false
PS C:\WINDOWS\system32> $doc=$WordApp.Documents.Open('C:\Rules\1.docx')
PS C:\WINDOWS\system32> $doc.Content.Font.Name = 'Castellar'
PS C:\WINDOWS\system32> $doc.Close()

you can track the appearance of files in a folder with this script
https://gallery.technet.microsoft.com/scriptcenter...
how the files will get into the right folder, how the changed files will be offered to the user - it's up to you =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question