?
Solved

Get text from form into Word 2010 Document via VBA in .Doc - can't use .Docx 500pnts

Posted on 2014-09-11
2
Medium Priority
?
369 Views
Last Modified: 2014-09-18
Ok,

So ideally what I want to do is have a form with text boxes which a user will fill out when they click the "OK" button the macro should do the following

Copy text string from the text box on the form and paste the value at a book mark in the document.

For example Form1.Text Box with value of "Pat" the macro needs to go to to bookmark FName and paste the content from Form1.Text Box ie "Pat"...

Or I just need to know how to get the value of variable to paste into a document at a certain bookmark...
0
Comment
Question by:ise438
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 2000 total points
ID: 40318182
Try this to start with:
Sub CommandButton1_Click()
     ActiveDocument.BookMarks("Pat").Range.Text  = UserForm1.TextBox1.Text
End Sub

Open in new window

0
 

Author Closing Comment

by:ise438
ID: 40329928
Worked a treat thank you...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question