Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 08-18-2020, 11:11 AM
Kindyr Kindyr is offline Naming a variable using userform fields Windows 10 Naming a variable using userform fields Office 2019
Novice
Naming a variable using userform fields
 
Join Date: Aug 2020
Posts: 12
Kindyr is on a distinguished road
Default

I figured it out!! S

Private Sub PrintBlurb2_Click()
' Declare everything strings.
Dim EVParty, EVNum, arr() As String
' Pull the values from the Userform text boxes of PartyTypeList and EvidenceID.
EVParty = PartyTypeList.Value
EVNum = EvidenceID.Value

'Create a simple array of one item that pushed the two items together into one item.

arr = Split("EVParty&EVNum| EVPartyEVNum", "|")

'Use the array zero point to create a variable with an out put that is the same as the name of the variable, but with a space in it.
ActiveDocument.Variables(arr(0)) = EVParty & " " & EVNum

' Make a message box that does the check.
MsgBox ActiveDocument.Variables(arr(0))

Unload Me

End Sub
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Show userForm from variable Cosmo Word VBA 5 01-31-2018 12:59 PM
Naming a variable using userform fields Assigning a string variable to a userform label caption Larry_1 Excel Programming 3 12-18-2017 06:59 AM
Project - variable data fields pmarc Word 7 04-04-2013 05:07 PM
30+ days Variable Day Date Calculations via Fields ztag Word 2 01-06-2012 11:12 AM
Variable fields? Emalee77 PowerPoint 0 01-30-2011 05:58 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft