<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Form Field &#8211; DEVelopers HUT</title>
	<atom:link href="https://www.devhut.net/tag/form-field/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.devhut.net</link>
	<description>MS Access &#38; MS Office Help, Tutorials, Samples and more ...</description>
	<lastBuildDate>Sun, 20 Nov 2022 12:05:02 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>VBA &#8211; Word &#8211; Update/Fill-in Document Form Fields</title>
		<link>https://www.devhut.net/vba-word-update-fill-in-document-form-fields/</link>
					<comments>https://www.devhut.net/vba-word-update-fill-in-document-form-fields/#comments</comments>
		
		<dc:creator><![CDATA[Daniel Pineault]]></dc:creator>
		<pubDate>Fri, 17 Sep 2010 12:00:41 +0000</pubDate>
				<category><![CDATA[MS Excel VBA Programming]]></category>
		<category><![CDATA[MS Word VBA Programming]]></category>
		<category><![CDATA[Form Field]]></category>
		<category><![CDATA[MS Access VBA Programming]]></category>
		<category><![CDATA[MS Excel VBA]]></category>
		<category><![CDATA[Word]]></category>
		<guid isPermaLink="false">http://www.devhut.net/?p=362</guid>

					<description><![CDATA[Have you ever needed to fill-in or update the form fields of a Word Document from say Access, Excel, &#8230; Below is a simple example of how you can do this. In it I demonstrate how to populate a textbox, as well as show you how you can check/uncheck a checkbox. '--------------------------------------------------------------------------------------- ' Procedure :&#8230;<p><a class="more-link" href="https://www.devhut.net/vba-word-update-fill-in-document-form-fields/" title="Continue reading &#8216;VBA &#8211; Word &#8211; Update/Fill-in Document Form Fields&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>Have you ever needed to fill-in or update the form fields of a Word Document from say Access, Excel, &#8230;  Below is a simple example of how you can do this.  In it I demonstrate how to populate a textbox, as well as show you how you can check/uncheck a checkbox.</p>
<pre>'---------------------------------------------------------------------------------------
' Procedure : UpdateDoc
' Author    : CARDA Consultants Inc.
' Website   : http://www.cardaconsultants.com
' Purpose   : Update/Fill-in a Word document's form fields
' Copyright : The following may be altered and reused as you wish so long as the
'             copyright notice is left unchanged (including Author, Website and
'             Copyright).  It may not be sold/resold or reposted on other sites (links
'             back to this site are allowed).
'
' Revision History:
' Rev       Date(yyyy/mm/dd)        Description
' **************************************************************************************
' 1         2010-Sep-17                 Initial Release
'---------------------------------------------------------------------------------------
Sub UpdateDoc()
'Requires a reference to the Word object library
Dim oApp        As Object 'Word.Application
Dim oDoc        As Object 'Word.Document
Dim sDocName    As String

On Error Resume Next
    Set oApp = GetObject(, "Word.Application") 'See if word is already running
    If Err.Number <> 0 Then     'Word isn't running so start it
        Set oApp = CreateObject("Word.Application")
    End If

On Error GoTo Error_Handler_Exit
    sDocName = "YourWordDocToOpenFullPathAndExtension"
    Set oDoc = oApp.Documents.Open(sDocName)
    oApp.Visible = True
    
    oDoc.FormFields("TextboxName").Result = "NewValue"      'Textbox
    oDoc.FormFields("CheckboxName").CheckBox.Value = True   'Checkbox

Error_Handler_Exit:
    On Error Resume Next
    oDoc.Close True
    oApp.Quit
    Set oDoc = Nothing
    Set oApp = Nothing
    Exit Sub

Error_Handler:
    If Err.Number = 5174 Then
        MsgBox "The specified file '" & sDocName & "' could not be found.", _
               vbCritical
    Else
        MsgBox "The following error has occurred." & vbCrLf & vbCrLf & _
               "Error Number: " & Err.Number & vbCrLf & _
               "Error Source: UpdateDoc" & vbCrLf & _
               "Error Description: " & Err.Description, _
               vbCritical, "An Error has Occurred!"
    End If
    Resume Error_Handler_Exit
End Sub</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.devhut.net/vba-word-update-fill-in-document-form-fields/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
	</channel>
</rss>
