Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programmatically create formatted text ?

Status
Not open for further replies.

soberhill

Programmer
Jul 20, 2012
1
GB
I regularly create a publication where the content is programmatically generated from a database. I create a text file and feed this into a publication template. Various parts of the text require different formatting styles. For years I have used an old desktop publishing package which allowed the import of a text file where each paragraph was tagged to indicate the correct formatting style.

I recently migrated to use Microsoft Publisher, but want to create a similar text file from the database. The problem I have is that this does not seem to allow paragraphs to be tagged to indicate a formatting style. I want to achieve a result where I do not have to go through the whole text in MS Publisher and manually apply a style to each paragraph.

Can anyone suggest a mechanism for loading a text file into Publisher where the text file automatically identifies the formatting style to be applied for each paragraph ?

Thanks, Keith
 
Hi Soberhill

I read your question and I think that there is most probably a way to achieve what you are wanting to do.
I am thinking that you may be able to do this by posting the text into a preformatted table using mail merge but there are some questions that I would have for your particular task that would indicate if this could be a potential solution or not.
Firstly are you pasting the information onto one page only ? .. and are the individual text blocks that have a specific formatting roughly the same size for each issue ?
Essentially what I think that you would need to set up your text styles in a blank "template" publication which you then paste a table or text boxes and format the individual cells or boxes as you want and place these where you want them to appear. Save your template and then any text that you import into a cell or text box via mail merge will be formatted to your predetermined style for that field.
As you can appreciate this will work best if the amount of text that you wish to insert for each edition is of a similar size so that you don't have problems with having to resize cells or boxes. Also I know about mail merging from Excel but I am not sure about Publishers ability merge from a text file so that might need to be another consideration.

Anyway that is something to think about but if you answer the above questions or have an example file that you can post I'd be happy to investigate it further for you.

Regards
Makonz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top