Consulting

Results 1 to 3 of 3

Thread: Linking listbox selection in userform to variables in document text

  1. #1

    Linking listbox selection in userform to variables in document text

    I have created a userform that contains, among other things, a yes/no listbox. When the user selects "yes" in response to the question in the userform, I need a specific sentence/paragraph to be automatically inserted into a specific place in the document body once the 'Populate Document" button is pressed. When the user selects "no", I need no changes to be made to the document text. What code can I use to make this happen? (I am an extreme newbie).

    Not sure if this will be relevant, but I have been using document variables to auto-populate other portions of the document from the userform.

    Thanks in advance!

  2. #2
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,335
    Location
    You are going to need a conditional field in the document if you want to stick with using document variables:
    { If { DocVariable "YesNo" } = "Yes""Now is the time for all good men.""" }
    Greg

    Visit my website: http://gregmaxey.com

  3. #3
    That worked! Thanks so much, Greg!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •