[2.0] Creating MS Word documents & using app data to fill it in
I could use some assistance on this subject.
Here's the link I was following to create a MS Word document:
http://www.c-sharpcorner.com/UploadF...romDotNet.aspx
It leaves me slightly confused because I'm not sure how to incorporate how I want the page to be formatted in c# code (even with using macros in MS Word).
The situation:
I'd like to create a standard MS word document in my c# app then fill up that document with data provided by my app.
The document would be formatted as such, in MS Word:
Tools -> Letters and Mailing -> Envelopes and Labels
[Label Tab] -> Label Type: Avery Standard, 5160
This should result in a single page document, broken up into 30 labels per page (3x10).
Now, I have a DataSet in my app that has the following columns:
Name
Address1
Address2
Address3
This DataSet can have anywhere between 1 and an infinite amount of rows. The names themselves have no specific sequence.
What I'd like to do is go through each row and place each mailing address into one of the labels. When the page (30 labels) gets full, it would make a 2nd page and continue on.
I am 100% completetly lost on how to do this. Looping through each row and performing x task is not a problem. It's knowing what kind of "MS Word Code" I have to do so it knows to enter that row's data into the next open label -- then switch to page 2 when page 1 fills up.
Re: [2.0] Creating MS Word documents & using app data to fill it in
Re: [2.0] Creating MS Word documents & using app data to fill it in
The first link was what I linked originally in my post...
The second link uses a 3rd party class that costs $60US (?)...
The third link deals with MS word (I know how to make the labels in word)...
The first link doesn't make any sense to me. The macros that word spit out have things like: (incoming pseudo code, too lazy to reopen word to get the exact syntax)
InputText "jim jones"
InputText.Return
InputText "123 street"
CellMove.Right(2)
etc..
If my goal is to create a word doc in code, format it (read OP to get the formatting params), then fill it with my app's data -- all without word ever opening, how would those macros help me?
Re: [2.0] Creating MS Word documents & using app data to fill it in
Quote:
how would those macros help me?
Well, I don't know if they would help you or not. But, 28 people have viewed your post and no one offer any solution. I just thought I would post the links and let you decide if they were of any value or not.
If they don't help you then unlucky, excuse me for trying to assist you. I will try and remember not to in the future.
Good Luck