Solved

Add a table to rich text item, using C API

Posted on 2004-08-27
26
424 Views
Last Modified: 2013-12-18
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
Comment
Question by:Jean Marie Geeraerts
  • 12
  • 4
  • 3
  • +5
26 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 11912391
JM... is this in R5 or R6 ?

~Hemanth
0
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 11912476
Still in R5. That's why I need to use API.
0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 11912523
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
 
LVL 15

Expert Comment

by:Bozzie4
ID: 11912539
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
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 11912546
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
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 11912567
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
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 11912939
How about creating ole objects of the word doc and embed it into your richtext ?

0
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 11929087
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
 
LVL 19

Expert Comment

by:madheeswar
ID: 11929192
look for Midas 3rd party tool.
0
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 11930490
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
 
LVL 31

Expert Comment

by:qwaletee
ID: 11932247
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
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 11939388
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
 

Expert Comment

by:robb3369
ID: 11942448
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 11942478
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
 
LVL 31

Expert Comment

by:qwaletee
ID: 11946624
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
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 11949644
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
 
LVL 19

Expert Comment

by:madheeswar
ID: 11950856
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
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 11950906
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
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 11950915
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
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 11952261
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
 
LVL 31

Expert Comment

by:qwaletee
ID: 11957437
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
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 11961015
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
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 11973196
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
 
LVL 63

Expert Comment

by:Zvonko
ID: 13033692
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
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 13061495
Well, I've found a very good solution through rtlib, so I'm okay with the question being closed now.
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 13061761
PAQed with points refunded (500)

modulo
Community Support Moderator
0

Featured Post

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

Join & Write a Comment

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 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

18 Experts available now in Live!

Get 1:1 Help Now