Solved

Create a publication in Word from a HTML data

Posted on 2016-09-11
14
72 Views
Last Modified: 2016-09-26
I have an MSSQL database (which I can easily export to Access) that has 2000 questions and answers. The data was entered via a browser and contains simple HTML codes, such as <p>, <b> and <em>. I want to merge this data into a publication in MS Word, with the HTML codes converted to the appropriate display. Is there a way to do this?
0
Comment
Question by:Lev Seltzer
  • 7
  • 7
14 Comments
 
LVL 22

Expert Comment

by:Kim Walker
ID: 41793520
View the page in your browser then save page as...web page complete. Launch MS Word and open the web page you just saved.

MS Word is capable of reading and writing HTML but it is somewhat limited. You may have to make some adjustments after opening the page in MS Word.
0
 

Author Comment

by:Lev Seltzer
ID: 41793942
I have 2000 questions in HTML code. I can't open and close each one.
0
 
LVL 22

Expert Comment

by:Kim Walker
ID: 41795338
Are they each on a separate page? Can't you view multiple questions on a page?

Do you have them on a local computer or are they on the internet? Do you have access to the site source files?

Re-reading the question I wonder if I understand what you're saying.
The data was entered via a browser and contains simple HTML codes, such as <p>, <b> and <em>.
Can you view the questions in a browser?
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:Lev Seltzer
ID: 41795430
I can easily view the questions - even all 2000 questions - in a browser. They appear in a table format. I want to merge this data into word in a different format.
0
 
LVL 22

Expert Comment

by:Kim Walker
ID: 41795453
You should be able to reformat after you import into Word.
0
 

Author Comment

by:Lev Seltzer
ID: 41795599
Good. How can I reformat?
I don't mind running a macro after the merge, thereby converting all <b> to bold, <I> to italic, etc. I just don't know how to do it.
0
 
LVL 22

Expert Comment

by:Kim Walker
ID: 41796025
When you view a page in your browser with all the questions on one page. Aren't the questions already formatted? You said they have HTML tags in them. Or are you seeing the HTML tags with the questions?
0
 

Author Comment

by:Lev Seltzer
ID: 41796406
The questions are perfect in the browser.
But I do not want to take them from there.
I want to connect to the database directly and I want to retain the simple formatting rules, which I would lose if I connected to (or converted from) the data visible in the browser.

I think I am going no where here, and will try to create a different question.
0
 
LVL 22

Expert Comment

by:Kim Walker
ID: 41796480
You shouldn't lose anything. Word recognizes all the HTML mark up. In fact you can create a web page in Word but I wouldn't recommend it. If you view the page in your browser, save it as a complete .html file. You can open it in Word and most of the formatting would be retained. There might be some minor tweaks required, but they should be minor.
0
 

Author Comment

by:Lev Seltzer
ID: 41803526
When merging a datafile whos entries contain formatting to a new document, MS Word will NOT include the formatting. it will be lost.
0
 
LVL 22

Expert Comment

by:Kim Walker
ID: 41804089
I haven't been talking about a datafile or new document.
The questions are perfect in the browser.
You have said you can view a web page with all the questions perfectly in the browser. If you save that web page document as a .html or .htm file to your local hard disk, you can open it in Word and the formatting you saw in the web page document will be retained to a certain degree. There are some complex properties that will not be retained but certainly any text formatting properties will be retained. I do this frequently to preview what an HTML email will look like in Outlook.

Can you provide a link to the web page that shows the questions? Or at least some of the questions?

Other than this, I am not aware of a method in Word of retrieving the formatted questions directly from the database. I would not be surprised, though, if there was a way in MSSQL to export the data to a Word document. But I doubt if it would render the HTML codes in the data.
0
 

Author Comment

by:Lev Seltzer
ID: 41804606
You are correct that I could view the data in a browser and then save the table in MS Word. It would be saved perfectly.

In fact, I have been doing that for a few years.

But now, I want to radically format the data and use it to publish a book. I do not want a table any longer. In a normal case, MS Word "mailmerge" would be a perfect solution. But here, I just end up with HTML tags such as <b> in the end product. I am now investigating, via a different ticket, if there is a way to write a MACRO to convert <b> (etc.) to BOLD and remove the tags. So far, no luck.
0
 
LVL 22

Accepted Solution

by:
Kim Walker earned 500 total points
ID: 41805886
I understand. I'm afraid I don't have any experience in that regard. Good luck with your other question.
0
 

Author Closing Comment

by:Lev Seltzer
ID: 41815559
I have hired a programmer to write a macro to convert the text. Thank you.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Safari On Gmail only html 12 54
Changing alignment and creating border 6 27
microsoft word short cuts 3 27
alert(innerHTML); 8 11
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

776 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