• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 448
  • Last Modified:

Add a table to rich text item, using C API

Hello Guys,

I need your help again.
A little background information : I'm writing an application that automatically imports the contents of a Microsoft Word document paragraph by paragraph.
Depending on the style of the paragraph a new document is created, possible made as a response to a previously created document or the contents of the paragraph is added to the rich text field of the current notes document.

As far as creating the documents and linking them as responses to keep the hierarchy intact there's no problem.
There's no problem for adding regular text and keeping the format (font, color, bold, italic, underline) properties of the text while importing the text in the rich text item.

I face however two problems :
1) How can I create a bulletted list in the rich text item?
    There are two levels of bullets, normal indent and one indent more.
    So I need to be able to set the level of indentation.

2) How can I create a table in the rich text item?
    The table needs to keep the format of the original word table.
    So it should be possible to merge cells across both columns and rows.
    The text inside the cells should stay formatted as it is in word.

Now I've had a look around the web already and it seems obvious that I need to use C API to get this done.
I have one problem though: I don't have the time to really examine C API and write it out.

So my question is :
Have any of you guys ever in the past created a rich text item or appended to an existing rich text item using C API?
I would really appreciate if you could give me :
1. declarations of needed C API functions
2. a code example to import a table into an existing rich text item
3. a code example of how to create a bulleted paragraph in an existing rich text item

The maximum amount of points for a question at EE is 500, but If needed, I can post follow-up questions.

Thanks in Advance,

JM
0
Jean Marie Geeraerts
Asked:
Jean Marie Geeraerts
  • 12
  • 4
  • 3
  • +5
1 Solution
 
HemanthaKumarCommented:
JM... is this in R5 or R6 ?

~Hemanth
0
 
Jean Marie GeeraertsApplication EngineerAuthor Commented:
Still in R5. That's why I need to use API.
0
 
Bozzie4Commented:
I only have something that creates  tables in rich text (rtf) .  It's Lotusscript, so that's easy, and it works in 4.6 and up.  

But if you save your Word file as .rtf, and import it, you should have the same result as what those classes do, so it probably won't help you.

cheers,

Tom
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Bozzie4Commented:
So my proposal would be:
- split word document in chunks (per paragraph), save those in .rtf (using COM)
- import rtf files into a richtextfield 1 by 1

You won't keep the formatting, since it will be limited to what rtf can do !

cheers,

Tom
0
 
Jean Marie GeeraertsApplication EngineerAuthor Commented:
Nope, you're that wouldn't help.
I need to have the tables created inside the rich text item of my notes document.

The goal of the application is to translate a few thousand word documents into native notes documents in a notes database. This way we can represent the information both in the client and on the web using the same notes database, but different forms. Cool, huh :-)
0
 
Jean Marie GeeraertsApplication EngineerAuthor Commented:
Thought about that, but don't really want to do that for a couple of thousand of documents.
I think the best way to go would be to create them straight into the notes document.

As I said for regular text I have no problems, there I can use regular LotusScript methods (rtItem.AppendRichTextStyle and rtitem.AppendRichTextParagraphStyle etc...)
0
 
HemanthaKumarCommented:
How about creating ole objects of the word doc and embed it into your richtext ?

0
 
Jean Marie GeeraertsApplication EngineerAuthor Commented:
Sorry, not good enough. They need to be native notes.
Besides the word document gets imported paragraph by paragraph and for every heading I need to create a new document that is a child of the previous level heading in the word document.

The only way to achieve this is through C API, that much I know from what I've looked up. It's not easy, that's why this question is 500 points :-)
0
 
madheeswarCommented:
look for Midas 3rd party tool.
0
 
Jean Marie GeeraertsApplication EngineerAuthor Commented:
We've looked at that too, but we'd like to have code where we don't need to install a .dll on the notes clients.
0
 
qwaleteeCommented:
Jerrith,

You don't need to install Midas on the clients.

1) It can self-install, no big deal

2) You can also set allthe processing to run on the srever, in which case, only teh server needs to have the DLL.  Clients don't need even a self-install
0
 
Jean Marie GeeraertsApplication EngineerAuthor Commented:
In our environment there is nothing like a self install, because users can't install any software on their PC. The PC's are maintained very strictly by central IT here, you can't change anything in registry or windows system folders for example.

As for the software on the server. I'm not sure our IT department is keen on that either. As said, I'd rather do it myself in C API. After all, that's just what those 3rd party software solutions do too. They just charge you money for something you could do yourself :-)
0
 
robb3369Commented:
Have you considered exporting the word docs as HTML and then import those into the RT field in Notes? You may lose some of the fancy formatting, but the basics would be there.

Rob
0
 
Jean Marie GeeraertsApplication EngineerAuthor Commented:
Considered it, but thought it to be too much of a hastle considering the junk HTML generated by word.
I'd have to filter out and translate the 'styles' generated by word and this would proove to be a task equally difficult as creating the table using C API.
0
 
qwaleteeCommented:
As to the self-install, it does NOT go to any windows folder, and I believe it does not use the registry.  It does deposit a DLL in the Notes executable directory, but I think it is possible in the Notes data directory.

As to not wanting to modify the server, bull puckey.  If you have a business requirement, and a budget, you can get it done.

You are looking for an easy answer to a hard problem.  Not going to happen.  Want to learn the CD API?  Be my guest, take the challenge, and grow!  But EE isn't the forum for teaching a course in it.
0
 
Jean Marie GeeraertsApplication EngineerAuthor Commented:
I wasn't looking for a course. Besides, I'm already halfway there.
I'm not going to give away 500 points just because you suggest some software that could do it.

Any program directories are read only here, so installing a .dll just isn't something you just do. Not anywhere. PC's are scanned and unknown dll's and executables are automatically removed.

If you know the procedures in a large company about introducing new software, you will understand that this isn't something I will just do on the fly. Even as a developer I'm not allowed to install any software on my computer without central IT first tested and approved it, which will take weeks and I just don't have weeks.

If you're not willing to help. Stay away :-p

Sorry for the harsh words, but I'm nearing a deadline and didn't get enough sleep tonight :-)
0
 
madheeswarCommented:
Jerrith cool down.

Qwaletee is just suggesting it will take lots of time to do it.

But you are the MAN! You are close to complete this task.

if you are willing to share your code, please send me an email to madheeswar at yahoo dot com


BEST OF LUCK.
-madheeswar
0
 
Jean Marie GeeraertsApplication EngineerAuthor Commented:
I know, I know. And I apoligize to qwalatee.

Anyways I might have found a very good alternative on http://www.rtlib.com.
This guy has a template with script libraries you can introduce into your own design and then use the script functions and objects from the libraries. There's even a help database that includes code samples, so I'm looking into this as a possible solution.
No software to be installed and clear explanation of how to implement the introduced extra classes and methods.

If you need to do anything with rich text, I'm thinking this is the thing to use and it's not too expensive either!!

I'm sure this is really going to save me a lot of time (and thus the company money) :-)
I'm working on a simple tryout database and am willing to share this if it turns out okay.

Using CD Records in C API will be for another day I guess.
0
 
Jean Marie GeeraertsApplication EngineerAuthor Commented:
P.S.: I already know it was gonna take a lot of time in C API. That's why I posted the question here.
You never know, possibly somebody had done the work in the past and was willing to share the code with us :-D
0
 
HemanthaKumarCommented:
Jerrith,

I remember Zvonko answering some sort of similar question to yours long back.. I could not find the link, mail him and get him involved here. He might have some soln...
0
 
qwaleteeCommented:
No umbrage taken.  I do't really pay attention to the points much, and you would have gotten the same answer for 10 points or 10,000 (if they allowed it).

I'd heard of rtlib, but have never tried it.  Didn't know it was that extensive (e.g., working with tables).  Thanks for the info.  Were I to use them, I'd need a different licesing scheme, because you can't use it effectively in a template (you would have to separate register each DB genned from the template).
0
 
Jean Marie GeeraertsApplication EngineerAuthor Commented:
OK. I'll mail zvonko and see if he's done something similar in the past.
I might not be going down the C API path at the moment, but you never know if it would be good for somehting in the future.
0
 
HemanthaKumarCommented:
The method what zvo mentioned was write a rtf (word format) table and import into the richtext field. I believe it needs frontend support. But that can be simulated using C api
0
 
ZvonkoSystems architectCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
    PAQ with points refunded

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Zvonko
EE Cleanup Volunteer

PS. Sorry buddy, as fast I have learned that stuff, as fast I did forgotten about it :(
0
 
Jean Marie GeeraertsApplication EngineerAuthor Commented:
Well, I've found a very good solution through rtlib, so I'm okay with the question being closed now.
0
 
moduloCommented:
PAQed with points refunded (500)

modulo
Community Support Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 12
  • 4
  • 3
  • +5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now