?
Solved

Given NoteID, view it with C API?

Posted on 2003-11-19
10
Medium Priority
?
772 Views
Last Modified: 2013-12-18
I have a notes add-in menu for the Actions menu written in C using the Notes API. I can get the NOTEIDs of all the notes I selected and I was wondering how I can "launch" these notes for the purpose of issuing a print and then closing the note. Any suggestions?
0
Comment
Question by:wym
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
10 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 9787337
I don't know that you really can do this, because there are no API provisions for manipulating the UI, at least, none that I know of.

What you could perhaps do is use the OLE automation classes to do this.  Instantiate Notes.NotesSession and Notes.NotesUiWorkspace.  Use NotesSession to open the database, and get a document object by note ID. Then use NotesUiWorkspace to return a NotesUiDocument object by calling NotesUiWorkspace.editDocument, passing it the document object retrieved earlier.  Finally, use teh NotesUiDocument object to print.
0
 

Author Comment

by:wym
ID: 9787784
Thanks for the suggestion, we tried to do exactly that.  I have a VB app to use Notes OLE automation by passing it a list of the UIDs that I got from my Add-In dll.  Unforunately, when I use NotesUIDocument.Print, it says method not supported...  I guess this is because it doesn't support COM?  

Is there any other way I can approach this?
0
 
LVL 9

Assisted Solution

by:Arunkumar
Arunkumar earned 400 total points
ID: 9788353
Try reading on .NDL extension files.  If possible build the .ndl file (which is very simple text file) and launch this file it will launch notes and the corresponding document.

FYI:
To get a sample .ndl file copy a document as link and paste it in notepad. Save file it with extention .ndl  thats it.  Now double click this .ndl file to see it launch notes and its corresponding document.


0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:wym
ID: 9788710
Thank you Arunkumar:

If I can build and launch this file, is there anyway I can detect the load  event to fire off a print and then close it?  Do I do this with an agent?

Sorry about these simplistic questions... I got parachuted in because I know C but I have no clue about LN and the C API turned out to be a bust.
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 9789232
yes you can do the print and close it too... all you have to do is in the postopen event of the form have a file print and also close.

Warning...Whenever this document is opened...it will be printed and closed but not open for reading....
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 600 total points
ID: 9795228
That's an interesting appraoch, having the PostOpen fire off a print and close, and build a link file to just get Notes to launch it.  

I don't know why NOtesUiDocument.Print did not work for you ... the docs say it shold work in COM (i.e., it is not listed as an unsupoprted method in COM).  Do other notesUiDOcument commans work for you, e.g., gotoField?

If you want to use the Postpen kludge, do sometheing like this:

In form PostOpen:
Dim s as new NotesSession
If s.getEnvironmentString("PrintImmediatelyOnPostOpen") = "True" Then
   s.setEnvironmentVar "PrintImmediatelyOnPostOpen , "False"
   Source.Print
End If

In your VB code:
docID = .....
Dim s as new Lotus.NotesSession
s.Initialize
s.setEnvironmentVar "PrintImmediatelyOnPostOpen , "True"
Dim ws as new Notes.NotesUiWorkspace
ws.editDocument False , s.getDatabase( .... , ....).getDocumentByKey(docID)
0
 

Author Comment

by:wym
ID: 9797904
Well, in the end we didn't go with the NDL.  I  don't have much experience with LN and my job was finished when I made the UID listing.  I was just testing it out in VB if I could print it.  Apparently, in the actual product, my boss has an intermediate form he launches with VB giving users choices to print all (mail, attachments), mail, or attachments.  I guess the buttons run the LotusScript code in the  PostOpen to print and close from reading the listing.  He says he's almost got it working and is ironing out some minor hiccups...  

However, I'd still like to know why .print doesn't work for me in VB(Object doesn't support this property or method).  I tried other commands like gotofield (Document command is not available), the only one that worked for me so far is IsNewDoc.

I don't know if this problem is related, but there seems to be a problem with uidoc if LN is not maximized.  Personally, my LN is maximized...

http://www.geocities.com/TimCottee/downloads/basLotusNotesModules1.txt

I'm also wondering if it has to be with using a VB app as an external process to LN and LN is not in the foreground.  Perhaps if I used the OLE automation writtin in CPP along with my Add-In menu?  I'd like to learn that, is there any code samples for CPP?



0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 9797935
My part is over I guess.... LOL !!!

:-)
0
 

Author Comment

by:wym
ID: 9798056
Actually, I was going to split the points.  I haven't closed it yet because my boss might still need some answers ;)  Plus, it would be good experience for me to learn about OLE in CPP... I just can't find any good examples of it for LN.  It can't hurt to learn a new skill since they are always bugging me about LN and I'm know crap about it!  They believe everything can be done throught the API and clearly I don't think so.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9804981
There are some C++ API examples, but I don't think any OLE code examples.  That's because Notes is usually an OLE container, not an OLE server (it is a server only for automation control or for NDL links).

You really need a good general-purpose book on C++ OLE or C++ ActiveX.  Once you have the general background, the Notes specifics will eb a piece of cake.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

764 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