How to Create a Word Button to Save a Form to SharePoint
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.

- 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.
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.
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.
Go to File > Options > Customize Ribbon. In the right pane, check the box for 'Developer' and click OK to enable macro and control tools.
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.
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").
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.

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.

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.




