Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 12-15-2015, 06:00 PM
macropod's Avatar
macropod macropod is offline Using combobox to pass data from an Excel spread sheet to text boxes on userform Windows 7 64bit Using combobox to pass data from an Excel spread sheet to text boxes on userform Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

In that case, you should be able to create a new document & populate the formfields using code like:
Code:
Dim wdApp As Object, wdDoc As Object
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If wdApp Is Nothing Then
  Set wdApp = CreateObject("Word.Application")
End If
On Error GoTo 0
With wdApp
  Set wdDoc = .Documents.Add("template path & name")
  With wdDoc
    .Formfields("EmployID").Result = Me.cboID.Value
    .Formfields("FName").Result = Me.txtFName.Value
    .Formfields("GName").Result = Me.txtGName.Value
    .Formfields("DOB").Result = Me.txtDOB.Value
  End With
End With
Formfields named as EmployID, FName, GName & DOB are assumed.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Value of Combobox in other userform Vibov Excel Programming 4 11-19-2015 04:12 AM
Using combobox to pass data from an Excel spread sheet to text boxes on userform Pass combobox content to header wpryan Word VBA 3 07-17-2015 01:44 AM
Using combobox to pass data from an Excel spread sheet to text boxes on userform How To Open an Macro From 2003 Excel in 2013 Excel Spread Sheet? ADubin Excel Programming 3 02-08-2015 04:57 AM
Mail merge, text boxes, and two documents per sheet! MelissaAnnie Mail Merge 2 09-24-2014 03:46 PM
Condensing a spread sheet hawkeyefxr Excel 4 08-22-2012 05:17 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:44 AM.


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