Freelance Project Requests info@CodeDocu.de Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net
#

Download:

Datei 1: Word_Property_Variable_with_Textbox.docm

 

 

 

Sample code to change the Title value as a variable in Word with a Textbox Control.

 

In Word you can import and modify internal and user-defined variables directly in the document. Internal variables can be externally best with Title.

If you want to use a property directly in a document as a variable, you can use a textbox control for the input in the example shown and adjust the title as you type in the textbox element.

 

The assignment is made with

ActiveDocument.BuiltInDocumentProperties("Title") = tbxNr.Value

 

 

The advantage of using MS Word document properties is that they can also be viewed directly in the file explorer.

This makes it easy to manage Word documents via the File Explorer.

 

As you can see, authors, categories, markers, and titles are placed directly in the file overview.

 

 

The internal variables or properties can be found in Microsoft Word under Menu bar-> Insert-> Fast blocks

Then document properties:

Author, subject, company, company address, category, comments, summary, keywords, status, title.

The easiest variables should be: title, status, subject, category, and summary

 

 

The following VBA code in MS Word directly changes the property [Title]

Option Explicit On

 

 

Private Sub tbxNr_Change()

    '----< tbxNr_Change() >----

    '*change internal variable propertie Title

    ActiveDocument.BuiltInDocumentProperties("Title") = tbxNr.Value

    '----</ tbxNr_Change() >----

End Sub

 

 

 

Subject: Field, Field, Variable, Property, Property,

Mobile
vba
»
Insert a line break at the end of a line and then insert text or a table
»
Word: insert characters at the end of a line
»
Text input fields in Word with vba c #
»
Create input fields in Word. C# ContentControls
»
Protect Word programmatically
»
Word vba: find current sentence
»
Word vba: Change document property title dynamically with Textbox Control
»
Word Code: Edit photos and controls in vba
»
Word: Find vba Code Example
»
Word vba macro: Changing WordArt with glow effect and shadow

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de