Solved

Given NoteID, view it with C API?

Posted on 2003-11-19
10
746 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
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

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 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

20 Experts available now in Live!

Get 1:1 Help Now