Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
1.25/5 (8 votes)
See more:
Hi there, I am new to programming and still in school for it. I am trying to create a small program that will have a few text areas that you can type into and then when done browse for a word document that you want to make the changes to and then hit a button that will automatically make the changes to the work document that has bookmarks in it for where the changes will go.

so just to reiterate a small app that has a shipping area, a customer area, a number area, and maybe 2 or 3 more areas that you fill in. the have a option to browse for the word document and select it. then a button to apply the changes to the corresponding bookmarked areas. thanks in advance,

respectfully,

poor student that took a class out of my league.
Posted
Updated 1-Sep-11 10:20am
v3
Comments
#realJSOP 1-Sep-11 12:43pm    
Why did you list every language in your tags? Which one are you actually using?
Maximilien 1-Sep-11 13:01pm    
Just resign from that class and concentrate on other classes.
fjdiewornncalwe 1-Sep-11 13:09pm    
Drop out of the class if it is beyond your capabilities to learn. We're certainly not going to provide you a solution that YOU will get marks for without any understanding.
Member 8205601 1-Sep-11 13:51pm    
i would like to use java script, and this is not for a class. I'm in intro classes. I am trying to create this for a simple form revision for my dads business. I'm looking for help not someone to be rude.
fjdiewornncalwe 1-Sep-11 14:05pm    
I'm not being rude, you didn't specify this information up front. BTW. You won't be able to do this with javascript as javascript cannot interact with applications like Word. You have create an application to do this. Do some research on Word automation and you will find what you are looking for.

I think that it might be simpler to only use Word for that.

In fact, I think "mail merge" just do that:

http://office.microsoft.com/en-us/word-help/word-mail-merge-a-walk-through-the-process-HA001034920.aspx[^]

If not, then recording and editing a macro in Word might be simpler and get the job done.

If not, then automation using C# 4.0 might be the next easiest solution...

They are many other possibilities like OpenXML SDK.
 
Share this answer
 
Sounds like a project that would work just fine using VBA or VB.NET or C#.

I'd be inclined to use VBA in word, since the app is designed to work on word files and I make the assumption that there will be further actions performed on some/all of the files modified - i.e print.

Using Named Bookmarks is very easy, as are input boxes and buttons. You'll have to fish around for some code that will grant you access to some of the functions not normally provided by VBA - these are quite easy to enable (a search for VBA MessageBeep should give you an example of how to implement such an extension).


Why not tackle the problem in steps. - Make a new program/macro/word doc for each step. Glue them all together to create a working app. It's what I do for these kind of exploritory/for-fun small-scale projects. Leaves me with a bunch of great examples too!

1. Read text from input box and display back to user using MessageBox (MsgBox)
2. Get list of files with .DOC extension in current directory (FileFindFirst FileFindNext)
3. Open chosen file in word
4. Display count of Named Bookmarks in chosen file
5. Display text of Named Bookmarks of chosen file
...
...
...
...


I've pulled data out of Oracle databases into Access before compiling a list of Attendance warning letters using Word automation (from access) for students that were falling short of the government-mandated 80% minimum attendance hurdle. While not operating at Warp-Speed 10, there was plenty of juice for what I needed to do. VBA is more than powerful enough to do this task for you. VB or C# would give you a stand-alone app, though if further work needs to be done to one/some of the files, Word will be open anyway.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900