Solved

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

Posted on 2014-09-11
2
360 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
2 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

840 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