Solved

Creating Macros for Microsoft Word

Posted on 2011-03-08
6
265 Views
Last Modified: 2012-06-27
I use a program that will let us merge data from the program to a word document.  Then the document is automatically saved in pdf form with in the program.  The problem is that the save form is the information that is on the form before it is brought up and we end up making changes to it.  Problem is then we need to save the letter and then import it, cause again when it auto imports it imports the information before changes.  A work around is to have the document answer a few questions, like a comment, that can be filled in before the document actually opens, thus saving the document automatically with the saved inputted information.  

So my question becomes, (See sample document) how can I with vbscript and word, have it ask for the choices before loading document, then have it filled in on the document.  In sample document I would need to know what needs to be checked and then enter a comment before the document actually loads.  Hope this is understandable.
 CL-NH-LEASE-VIOLATION-NOTICE.doc
0
Comment
Question by:mgmhicks
[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
  • 4
  • 2
6 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 35072381
It is a little difficult to understand the scenario here. I think that we would need more explanation.

Here are a few points:

If the document is already a PDF, you would need to convert it back to a Word document if you want Word to edit it.

The document that you posted is not built for easy data entry. It looks designed for manual entry on to paper.

It would probably be better to use VBA rather than VBScript.

Here is a forms document that can be filled in. It is protected (without a password) to demonstrate its use.
LeaseViolation.doc
0
 

Author Comment

by:mgmhicks
ID: 35072425
ok, so what happens is I put this document into our software package, when it loads it automatically saves it to a database with my software package.  With the document you just sent me it would save a blank document (nothing filled in once it loads.)  But If I can get Word throught ASK Field or something like that, to ask me what needs to be checked before it loads completely, the program will then save the document with answers filled in.  Does that help.  So I know I can build a macro or something that would ask the questions upon load, but how to get answers filled into the form you just filled or similiar is the question.

thanks
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 35072789
Outside You might like to try using Fill-In fields. Place each one where you need the text to appear, and make the prompt appropriate.
0
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!

 
LVL 76

Expert Comment

by:GrahamSkan
ID: 35072871
I don't know where the word 'Outside' came from. Ignore it, please.
0
 

Author Comment

by:mgmhicks
ID: 35072881
Can we write a little vb routine, that will load a window with lets say button control and have the answers there corespond to answers we need on the document.  Fill the answers and comment for that matter, then finish load of document with the answers?

0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 35073160
Yes, but the problem might be in starting it.

Does the document have its own unique template? If so, you could try putting these macros into the template to test the situation. They would have to go in the ThisDocument module of the template.

Also, try putting a Fill-in field on the document's template to see if that works.



Option Explicit

Private Sub Document_New()
    MsgBox "New"
End Sub

Private Sub Document_Open()
    MsgBox "Open"
End Sub

Open in new window

0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
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
Course of the Month8 days, 22 hours left to enroll

617 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