This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to modify Word document from M-Files Server VBScript?

Former Member
Former Member
I want to create a script on M-Files server that sets "Track Changes" when a Word document enters a certain state and "Accept All Changes and Stop Tracking" when the document enters a later state.

State Draft: "Track Changes"
State Submitted: -
State Reviewed: -
State Accepted: "Accept All Changes and Stop Tracking"
State Issued: - (next state is Draft for next major version of document)

I found the place in M-files Server Administrator to create the VB Script: Vault/Workflows/Properties/State/Edit/Actions/Run Script

According to the documentation the following variables can be used in the script: VaultSharedVariables, MFScriptCancel, CurrentUserID, Vault, DisplayID, ObjVer, PropertyValues, and StateID.

In Word VBScript I can set this propertiy by with:

ActiveDocument.TrackRevisions = True

How to do the same from M-Files server script?

Best regards

Erik
Parents

  • I have document template Agreement (MS Word file) which consists from topics and table of items. Item's comes from standalone objects joined with Agreement via metadata field "Agreement". I need to change item's table content in DOC file if any items have changed.

    It's possible to go this way?


    This is a little different question but there are a few things you can do:

    You can update the metadata fields on the server-side when the file is delivered from server to (any client). See chapter 6.4:
    kb.cloudvault.m-files.com/Default.aspx

    You can update and modify Office documents programmatically with something like Aspose. So you can call Aspose dll in your event handlers and vault applications:
    https://www.aspose.com/

    Mika
Reply

  • I have document template Agreement (MS Word file) which consists from topics and table of items. Item's comes from standalone objects joined with Agreement via metadata field "Agreement". I need to change item's table content in DOC file if any items have changed.

    It's possible to go this way?


    This is a little different question but there are a few things you can do:

    You can update the metadata fields on the server-side when the file is delivered from server to (any client). See chapter 6.4:
    kb.cloudvault.m-files.com/Default.aspx

    You can update and modify Office documents programmatically with something like Aspose. So you can call Aspose dll in your event handlers and vault applications:
    https://www.aspose.com/

    Mika
Children
No Data