Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-20-2017, 09:34 AM
Formd Formd is offline Open Userform once and apply the same selection to multiple documents Windows 7 32bit Open Userform once and apply the same selection to multiple documents Office 2007
Advanced Beginner
Open Userform once and apply the same selection to multiple documents
 
Join Date: Feb 2015
Location: TX
Posts: 49
Formd is on a distinguished road
Default Open Userform once and apply the same selection to multiple documents

Hello everyone. I hope I word this issue so you can understand what I am trying to accomplish and assist if you can. I created a document that has merge fields and a userform to complete the merged document. I use AutoOpen in a macro to show the userform (Myform.show) and vba to add data per the user selection. It works perfect if I am using on a file with only one party listed in the db. Problem is, if there are more than one parties listed in the db for the file I am merging, the document opens for each listed party and because I have AutoOpen, so does the userform. Is there a way I can have the userform open only once, even if there are multiple parties, but the data the user selects when the userform opens applied to all?

Scenario
4 parties in my file. Userform opens and ask,
Question - Is this a renewal? Response = Yes.
Selection from drop down list - First Renewal, Second Renewal, Third Renwal.

If user selects Second Renewal, how can I have Second Renewal applied each of the four times the document opens without having the form open each time and making the same selection 4 times? Here is the vba I am using.

Private Sub Cmdone_Click()
If Cbparty = "Yes" Then
With ActiveDocument
.Bookmarks("Renew1").Range _
.InsertBefore (Cbrenew)


.Bookmarks("Renew2").Range _
.InsertBefore (Cbrenew)
.Bookmarks("Renew3").Range _
.InsertBefore (Cbrenew)
End With
End If
Me.Hide
End Sub
Private Sub UserForm_Initialize()
Cbparty.AddItem "Yes"
Cbparty.AddItem "No"
Cbparty.Value = "Select One"
Cbrenew.AddItem "Renewal "
Cbrenew.AddItem "Second Renewal "
Cbrenew.AddItem "Third Renewal "
Cbrenew.Value = "Select One"
End Sub
Private Sub Cbparty_Change()
If Cbparty = "Yes" Then
Cbrenew.Top = 40
Lbnew.Top = 43
Cmdone.Top = 75
Me.Height = 125
Me.Width = 243
ElseIf Cbparty = "No" Then
Cbrenew.Top = 150
Cbrenew.Value = "Select One"
Lbnew.Top = 153
Cmdone.Top = 48
Me.Height = 108
Me.Width = 243
End If
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Userform once and apply the same selection to multiple documents Apply Heading Style When Combining Documents snot369 Word 1 01-13-2017 11:04 AM
Open Userform once and apply the same selection to multiple documents Saving multiple open Word documents jpaul Word 1 03-09-2015 01:23 PM
Word no longer allows multiple documents to be open Steve's Computer Word 1 03-22-2014 01:55 PM
Open Userform once and apply the same selection to multiple documents How to apply a list style to multiple Word documents? MrSnrub Word 4 06-19-2013 07:32 AM
Open Userform once and apply the same selection to multiple documents Apply template to multiple documents Oliver Beirne Word VBA 2 04-24-2012 04:49 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:29 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