Solved

Help Don't know vb.

Posted on 2004-04-06
9
157 Views
Last Modified: 2010-05-02
I have directed to create a word document that would pull data from a sql2k db into a word document and have that document formated correctely(margins, tabs etc..)
the current way that this information is being displayed is thru the web, but in doing that it loses its formating and printing is a nightmare.

the current format for this document would be

document header (centered onthe page)

date                                                                                        

name1                                                                             name3
company1                                                                        company3
address1-1                                                                       address1-3
address2-1(if not null)                                                       address1-3(if not null)
city1, state1 zip1                                                               city3, state3 zip3

name2                                                                             name4
company2                                                                        company4
address1-2                                                                       address1-4
address2-2(if not null)                                                       address1-4(if not null)
city2, state2 zip2                                                               city4, state4 zip4


Page #

can anyone help with some guidance on how to do this.
0
Comment
Question by:jriver12
9 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 10767129
looks like what you eed to do is a variation of 'MAIL-MERGE', but you want to create labels.

Open Word, then under the Tools menu button, click on Letters and Mailings, then Select Mail Merge.  You can then follow the instructions from the Wizard.

AW
0
 
LVL 4

Expert Comment

by:JpmSoft
ID: 10767857
I think that if you plan to put those "reports" on the web again, Word is not the right answer to your problem...

You might try to test Crystal Reports or other reporting tools like this.

JPM
0
 
LVL 15

Expert Comment

by:unknown_routine
ID: 10768321
should there only be 4 name section on the page?
0
 

Author Comment

by:jriver12
ID: 10768472
nO it can be any number. I have tried the suggestion by Arthur_Wood, but
in doing so I would still have to have the user format per the correct sort order, and the pages would have to be predefined and if any number of records is added the template would have to be altered to accomodate that new record.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 10768638
Pulling the data into a Word document probably isn't the problem.  The problem is saving the Word document in HTML format.  So long as the document is saved in Word, or possibly even RTF, format, then it should retain all its formatting even when displayed on the web.  The real issue is that HTML formatting doesn't give you all the formatting features that a Word document has.  Another alternative would be to save the file in Adobe Acrobat format, assuming you have Acrobat.  
0
 

Author Comment

by:jriver12
ID: 10768823
I don't need it to be saved back into html. just need it to be in word.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 10769254
Sorry to be dense but I'm lost on what you're looking for.  From your original post I thought you already had created the document in Word and had discovered that when posted to a web site its formatting was screwed up.  So I thought the question was how to avoid having the formatting go away.  But now it sounds as if you're asking how to create the Word document.  Or maybe I'm still misunderstanding and it's something altogether different.  Could you clarify what it is you want us to answer?
0
 

Author Comment

by:jriver12
ID: 10778094
No, I don't have to post it to the web.

I am using coldfusion to pull the data from the db to the browser, however formating when printing is an issue, I am looking for a way to pull the data from the db into a word document so that the user can format it (margins, pagebreaks and record order).

know that the query sorts and orders the data but when pulled into a mailmerge that order is lost.

the way it should be is:

rec1                   rec3
rec2                   rec4

the way mailmerge pulls is:
rec1                   rec2
rec3                   rec4.

hope this clarified it.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 10779933
jriver12,

Can you provide details about the data coming in from the db?  Specifically, please describe the formatting you need it in inside the document.  Also, will each record be the same length (i.e. occupy the same number of lines in the document)?  Any other formatting details you can provide would be useful.  

You mention "... so that the user can format it ..." in your description.  Does that mean that all you really need is to get the data into a Word doc and then the user will do the rest, or do you really want a fully formatted document?
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

746 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now