logo
search
SharePoint Document Issues

How to Create a Word Button to Save a Form to SharePoint

Nimra MalikNimra Malik Oct 14, 2026 869 views

Question details

The user wants to add an automated button to a Word fillable form that saves a completed DOCX copy to SharePoint using a filename generated from form fields, while preventing applicants from viewing the saved files.

How to Create a Word Button to Save a Form to SharePoint
Product
Microsoft Word, SharePoint
Device & OS
not provided
Scenario
Designing a fillable form with a one-click submission process that uploads directly to a secure SharePoint library.
Observed behavior
Requires a custom VBA macro to handle the dynamic filename and saving process, alongside specific SharePoint permission configurations to restrict applicant view access.
Before you start

Ensure you have basic knowledge of Visual Basic for Applications (VBA) and hold administrator or full-control permissions in your target SharePoint document library to adjust access settings.

Solution 1Recommended

Use VBA and Configure SharePoint Library Permissions

Combine a VBA macro assigned to a command button with SharePoint item-level permissions to achieve the automated saving and access restriction.

Implementing a one-click save button requires custom VBA scripting to extract data from your form fields and push the document to a SharePoint URL. Since VBA interacts directly with local and network environments, ensure your SharePoint site is trusted and accessible.

For highly specific code generation tailored to your exact form fields, it is highly recommended to consult the official Office VBA support community.

1
Enable the Developer Tab in Word

Go to File > Options > Customize Ribbon. In the right pane, check the box for 'Developer' and click OK to enable macro and control tools.

2
Insert an ActiveX Command Button

Navigate to the Developer tab, click on 'Legacy Tools' in the Controls group, and select 'Command Button (ActiveX Control)'. Place it where you want the submit button on your form.

3
Write the VBA Save Script

Double-click the newly inserted button to open the VBA Editor. Write a script that assigns form field values to a string variable (for the filename) and uses the 'ActiveDocument.SaveAs2' method pointing to your SharePoint URL (e.g., "https://yourdomain.sharepoint.com/sites/LibraryName/" & FileName & ".docx").

4
Restrict SharePoint View Permissions

Open your SharePoint document library in a web browser. Go to Settings > Library settings > More library settings > Advanced settings. Under 'Item-level Permissions', set 'Read access' to 'Read items that were created by the user' to prevent applicants from seeing others' submissions.

Use VBA and Configure SharePoint Library Permissions
VBA Support: Because this workflow depends heavily on custom VBA scripting, you may need to post your specific implementation code in the Office VBA support community for expert debugging.
Free Microsoft Office alternative

Try WPS Office for Your Document and Form Needs

If you are looking for a lightweight, cost-effective solution for creating and managing documents, WPS Office is a powerful alternative to Microsoft Office. It offers a familiar interface, robust features, and excellent compatibility.

High compatibility with Microsoft Word (.docx), Excel (.xlsx), and PowerPoint (.pptx) formats.Built-in form filling, document protection, and advanced PDF conversion tools.Free to use, exceptionally lightweight, and launches quickly on Windows, Mac, and Linux.Familiar user interface ensuring a seamless migration with no learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Can I save a Word document to SharePoint without using a VBA button?

Yes. You can manually save a document to SharePoint by clicking File > Save As, selecting your connected SharePoint site or OneDrive, and choosing the target folder. However, this manual method will not automatically name the file based on form fields.

Why is my VBA macro failing to save the document to the SharePoint URL?

This commonly happens due to permission errors, incorrect URL formatting, or requiring a mapped network drive. Ensure that the SharePoint URL is fully accessible from the user's Word application and that they have write permissions to the destination library.

How do I ensure my Word macros run when users open the form?

Users must have macros enabled in their Word Trust Center settings. You can instruct users to click 'Enable Content' when they open the document, or you can host the document in a Trusted Location so macros run automatically.