

If there are form objects there, then you've got forms.Under the project labeled with your current document name, are there any form objects listed? I think it'll say that it is a Form if it's there, and should have an assigned name as well. There should be a pane that says "Project." at the top. In the VB Editor window, look on the left hand side/pane.If you're unsure about the Word Doc forms, you can find out this way (probably other ways as well, but this is the easiest I can think of right now): This will then give us a list of fields to populate. If we’re just using the same document to populate each time, then we can simply select the Location, Document Library and File. Now, this is where things can fall apart easily. Where the same metadata value (e.g., ‘Client Name’) appears more than once, that value appears throughout the document where required at the same time. Populating the Word Template (Generic) We need to add the ‘Populate a Microsoft Word template’ action to our Flow. Auto-populates the Word documents where required with the metadata in the form.
#AUTO POPULATE WORD DOCUMENT FIELDS SERIES#
However, if you can get Mail Merge or Bookmarks to work for you, and you don't know any of the above, the latter 2 would be easier, I think.įrom a VBA perspective, where does the initial action take place? Does the user open a Worksheet, enter some data, and then open the Word Doc and enter/copy the same data there?Īlso, the forms in Word, are they forms attached to the document? Are you sure they are actual forms, and not just a series of fields plugged into the Word Doc? Auto-creates one or more Word documents (multiple based on metadata choices contained in the form). The other options can be used along with VBA, but you can probably do it solely with VBA. This could be useful for mass mailings or for forms that you need to fill out repeatedly - and you won't have to use VBA.
#AUTO POPULATE WORD DOCUMENT FIELDS CODE#
The relevant VBA code to generate this field at the end of the active document: Dim doc as Word.Documentĭoc.Fields.Add rng,, "IncludeText " & Chr(34) & "C:\\Test\\TestFormsProtection.Well, VBA will definitely do what you want. Note that there is no reliable (sometimes it might work, but other times not) way to use relative file paths with Word field codes.

This creates an IncludeText field in the document that references the file path to the source document and the bookmark content: practitioner (sender of the letter) Ideally, Id like to add a button to a form and when a user clicks it, it will take the information from the fields in that specific record and fill in the blanks of the letter. Drag the field you want from the Data Sources window to your document. For more information, see Add new connections. Open the Data Sources window and create a data source from a database. Open a Word document-level project in Visual Studio, with the document open in the designer.
