Solved

Given NoteID, view it with C API?

Posted on 2003-11-19
10
751 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
  • 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 100 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 31

Accepted Solution

by:
qwaletee earned 150 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Lotus Notes Mail Database issues 2 894
Lotus notes VB code 4 204
External emails not coming through 3 100
Adding a named anchor in a Lotus Notes Form 6 83
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…
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

929 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

11 Experts available now in Live!

Get 1:1 Help Now