Lotus Notes #command to mark the current email as read? - email

Does anyone know of a way to mark the current email as read using an #command?

If by "current document" you mean a the selected document in a view, you can use
ToolsMarkSelectedRead #Command
In a view or folder, marks all of the selected documents as read.
Syntax
#Command( [ToolsMarkSelectedRead] )
Usage
A database must be open at the view level
or
A document must be open in Read or Edit mode
Note In some databases, there is no difference in the display of read and unread documents in views and folders.
This command does not work on the Web.
Also, unless it's a new method in R8, NotesDocument.MarkRead is not an existing method. The only way you could do this would be to call NotesDocument.Save, and pass in true for the markRead parameter:
flag = notesDocument.Save( force, createResponse [, markRead ] )

Related

When implementing a "onReferences" with visual-studio-language-server, how do I search through the content of the files in the workspace?

I'm currently implementing onReferences on the server side of a language server. When a user right clicks on some custom syntax in a markdown file, I want to be able to use that syntax to search for other occurances of strings elsewhere in the workspace.
connection.onReferences((params) => {
// I can get the syntax here from the client through params and the document manager
// but I only have access to the document manager and the open documents.
// I want to be able to return a location from a possibly unopened file elsewhere
return null;
});
Since I know this happens all the time with the ts-server (click on an interface name and find all occurances) I know this is surely possible. What general strategy am I missing that I can obtain locations of strings elsewhere?

How to use VBScript to lock a specific region of a Word document?

So I want to make a specific part of a Word document read-only using VBScript.
The version of Word I am using is from Office 16.
How to do this manually (recorded a macro for this to see if I would get a better idea on how to do this) I found here.
I know how to lock the entire document, and know that the following works:
'Protect Document
objDoc.Protect wdAllowOnlyReading, True, "password"
I saw this question being asked (on an old MS forum), but nothing more than this.
Any help with this sort of issue on an example I would appreciate.
While you can't do this using the Protect() method directly the answer appears to be in the Question you linked from the MS Forum.
' Protect Document
objDoc.Protect wdAllowOnlyReading, True, "password"
' Select last paragraph of the document
objDoc.Paragraphs.Last.Range.Select
' Make an exception for current selection
objWord.Selection.Editors.Add(-1) ' -1 = everyone
Using the Selection object you can modify the Editors on a protected document selection to "everyone" which unprotects that selection only leaving the rest of the document still protected.

Add Eventhandler to Object of type Word.Application

With the following code I open a a new word document. To save the word document programmatically I want to add an event listener to the object, which occurs when word will be closed. Is this possible?
Set objWord = createobject("Word.Application")
objWord.visible = True
Set objDoc = objWord.documents.add()
Call objDoc.content.select()
Set selection = objWord.selection()
Call selection.collapse()
objDoc.Close
Set objDoc = Nothing
objWord.Quit
Set objWord = Nothing
EDIT:
I try to explain better what I want to do. My Lotusscript Agent should open a word document for the user. The user types in some text and then closes the word document. Instead of showing the save dialog of word I want to save the document programmatically to embedd the file as attachment to an notes document. Until now I have not found a solution to get an handle of the event when word is closing.
I think this link on one of the ldd wikis probably has what you need. If you are a little clearer on what you need, you may get better answers though.
I think you are wanting to be notified when word closes so you can force a save or something correct? You can already force the save using similar lotusscript to how you are closing it, you don't need to wait until they close it themselves.

Powershell and Lotus Notes - How to extract user names with employees numbers?

I have specific problem. I need to extract domain names from active directory and combine them with employees numbers which are in Lotus Notes. I get the domain names with Get-QADUser (snapin from quest.com), that was no problem, but how to get the employees numbers and combine them? Thank you
Edit(18.5. 11:56): Now I'm using this script (posted by Christian) and I figured out how to get the name of LN database - right-click on DB in Lotus notes workspace, then application/properties.
# Create LN Object
$DomSession = New-Object -ComObject Lotus.NotesSession
# Initialize LN Object
# You'll be asking for LN password to your id
$DomSession.Initialize()
# Connect to Server, select db and display the name
$DomDatabase = $DomSession.GetDatabase("LN007","IT\HW.nsf")
Write-Host "Database open : " $DomDatabase.Title
# Open specific View (By Serial Number)
$DomView = $DomDatabase.GetView('Serial Number')
Write-Host "View read : " $DomView.Name
# Show number of documents
$DomNumOfDocs = $DomView.AllEntries.Count
Write-Host "Num of Docs : " $DomNumOfDocs
# Get First Document in the View
$DomDoc = $DomView.GetFirstDocument()
If you have access to the database and a Notes client, you can open the database in Notes Designer and review what views are available. You should then be able to find one or create one that contains the data you need.
If you don't have access to Lotus Notes, you're close enough with your powershell script that you can use the com API to get the information. The NotesDatabase object (i.e. $DomDatabase) has a Views property which will return NotesView objects. You can iterate over those and print out the names as a start. Likewise once you've found the view you want, you can access the columns within that view using the NotesView's Columns property.
You'll want to check out the COM api docs here for more help: http://blagoevgrad.court-bg.org/help/help85_designer.nsf/Main?OpenFrameSet (see the section LotusScript/COM/OLE Classes)
Depending on how comfortable you are with Powershell vs the com api, you could probably handle this a few ways, either by extracting all the documents in the view and getting the data out, or perhaps using the built in NotesView.GetDocumentByKey method that would act as a lookup in your script. With a view sorted on the key you're querying on (and set as your view's first column), you could call that method and get back the document with that key. Then use that NotesDocument object to retrieve any value within it (i.e. the employee name or number or whatever)
You can retrieve data from Lotus Notes using com object.
Suggested links:
http://davidmoravec.blogspot.it/2008/08/retrieve-data-from-lotus-notes-with.html
Lotus Notes comobject
Is the database you are opening called "names.nsf" by any chance? If so, that's the standard Domino Directory database and you should be using the "People" view, and the item name you are looking for should be "EmployeeID" -- unless the customer has customized the database with their own field names.
If it is a custom database you are working with, then in addition to using the Notes client and Domino Designer, get yourself a copy of NotesPeek. It's free. Download here
It gives you a tree view of the database. It shows you everything that is stored in the database -- but it only shows you what is stored, so computed fields that you can see in the Notes client but aren't accessible through the Notes classes won't confuse you. (The document properties dialog in the Notes client won't show you computed values either if you use it while you have a document selected in a view, but it will show them to you if you use while you have a document actually open.)

Setting / accessing the Application.CutCopyMode property via UI

We are facing an error of "This method or property is not available because the clipboard is empty or not valid" in one of our Lotus Notes applications. The code basically opens a document, selects all the text, copies it and then pastes it in MS Word document. It does this continuously for a bunch of documents. I found this link which basically suggests adding Application.CutCopyMode = False to the code to resolve the issue.
I need to know can this property be accessed and set via UI for MS Word?
In the example you reference, that Keyword is actually part of the Excel object model, not the Word object model. So you are unlikely to find it in Word's UI. Perhaps you are doing something with Excel as well, or perhaps it is a keyword in the relevant Lotus object model as well?
[
The OP mentioned a link, http://www.tech-archive.net/Archive/Word/microsoft.public.word.vba.general/2007-06/msg00446.html
that suggested changing variables names, but that that did not work.
The linked article also suggests "sleeping for a few milliseconds between copying and pasting"
]