VBA - Lotus Notes - Output Email History - excel

I hope someone can put me on the right path, I have code that simply outputs emails received today into an excel spreadsheet by connecting to the database and then popping out the NotesDocument.Document items. Now what I cannot see within those items is reference to History as I'd like to be able to tell whether these output email have been replied to.
If anyone knows what I could look into or read to help me retrieve this information it would be greatly appreciated.

If you look at the (FollowUpMemoSubform) in the mail template, you will see that it contains this section.
The appearance of these lines is controlled by hide-when formulas that check for a NotesItem called $RespondedTo. The logic for the first line ("This message has been replied to") is
#IsNewDoc | !#IsAvailable(DeliveredDate) | !#IsAvailable(PostedDate) |
!#IsAvailable($RespondedTo) | !$RespondedTo="1"
The hide-when formulas for the other two lines are similar, but they are checking for "2" or "3".
The basic logic is: It's been replied to if $RespondedTo is 1 or 3. It's been forwarded if $RespondedTo is 2 or 3. The checks of DeliveredDate and PostedDate are there (I think) to exclude drafts. The check of #IsNewDoc is there for when you are composing a brand new message that has not yet been saved, but that's not an issue for you since those messages aren't in the NSF file so you'll never read them.

Related

How do i write more complex code in Lotus Notes views

i currently work on a project where i have to write a programm which processes raw data from a
Notes Database into an excel file using Lotus Script. The Database contains time information about how long different devices have been lend out. The output from my script looks like this:
June
Device
Counter
Times(Minutes)
Times(Hours)
--------
--------------
--------------
--------------
TestDevice1
3
270
4,5
TestDevice2
2
210
3,5
I am finished with the programm itself, now i need to have the same Output inside a Lotus notes View. I am very new to lotus notes and i have no idea how to do this. I know that it is possible to use Lotus Formula to programm. But i cant find anything about the language and how to use it. Maybe someone here can help.
You can look at the online documentation provided by HCL "About Designing Views"
Pay particular attention to "Selecting which documents display in a view" and "Creating columns in a view" (and its subsection "
Adding programming to columns").
That should give you a few ideas of how to progress.
You can get close.
Make a view to display the Device, Counter, Times, and Times columns, unsorted.
Once you figure that out, create a new column that displays the month. (Hint: See #Text formula.)
Now change it to subcategorized by month by changing the month column to be the first column, and then edit the column properties to give it a width of 1 or 2, not resizable, and make it a category column with twisties shown.
This will get you close. Instead of the month followed by column titles followed by the data, you will get column titles followed by the month followed by the data per month.

From Excel to Outlook: how to do the link especially with files such as PDF

First a few words of context:
In my company we always have to attach 3 PDF files when it comes to sending an e-mail (by Outlook) to a client regarding a product. Sometimes when we speak about several products, we have to send even more PDF files. Hopefully some files are redundant because they are "family" of products but still it's really a mess.
Then I got the idea of creating an excel sheet with the list of all the products and all the associated PDFs to send. The idea is to tick the box of which files we want to send then click on the big email icon and all the chosen documents will be already attached to an e-mail in Outlook. After that all you have to do is to write the name of the client and you're done: send it!.
Having an idea is great but implementing it is better. That's where my Excel and VBA skills are lacking.
Here are the questions:
1.how to assign a pdf files to a "box"
2.how to create the link from Excel to an email in Outlook by simply clicking on the mail icon so that all chosen documents are attached in the email?
Here are the pictures that will help you understand the issue.
Your approach is almost right, but off a bit. Please see the link below. You should find your answer there.
http://www.rondebruin.nl/win/s1/outlook/amail6.htm

Pick distinct email list from excel and send email through macro

I have got an excel sheet with many email ids (duplicates also).Need a macro which can pick distinct email ids from the list and send email to all of them in a single mail.Also the mail subject must contain date e.g Release X report dated DD-MMM.Mail body should copy a range of cells from the same excel sheet.Can someone please help me with the macro.
Provided you have the outlook client installed - take a look at this http://www.rondebruin.nl/win/s1/outlook/bmail2.htm. It looks like a nearly right out of the box answer, even though you still need to get into it a little bit and adjust mail parameters to your case
This code basically involves 2 main parts:
- the main Mail_Selection_Range_Outlook_Body procedure, which sets an instance of the outlook application, creates an email, populates parameters (to, cc, subject, body...) and sends the email
- the RangetoHTML utility function called by the main procedure, which publishes the excel data range to be sent to HTML. The result is assigned to the mail item HTMLBody - not Body - property in the main procedure for proper rendering
You should select your source data range before running the main procedure.
For test purposes, you may find it helpfull to replace the ".send" mail item property with ".display" in a first place - this will result in the main sub displaying the ready to be sent mail on screen rather than actually just sending it.

Excel VBA to pull name from body of email

I am looking for some code to pull values from the body of an outlook message. I will set up the whole situation I need below:
An email is sent with specific subject and certain values in body.
-Subject could be "Test"
-In body of email it would be:
Name: (name here changes)
Number: (number here changes)
I can set up the Excel file I need to open after this email is received, but what I need is for that Excel file that opens, to look back at that email message and pull the name and number (that can change) into cells A1 and B1.
Keep in mind that there will be multiple emails coming through with this same format, so it should only look in message that was just sent a minute or two ago.
Is this possible? Any help would be greatly appreciated. Thanks.
Since the triggering action is the receipt of an email, I would suggest that you focus on having Outlook running the script when the message is received and then pushing the information to the Excel sheet. Here is something that will get you started.
You will want to make sure that there is a way to easily identify where the name field is on the email body too, possibly wrapping it like [[NAME]] Person Name Here.

fetch data from ms-access to ms-word

i am looking to create an invoice in either MS-excel or MS-word. This invoice will contain several fields like invoice no., customer name, product info, quantity, Amount, Date, Address of customer, phone no. etc. The function of the invoice will be, to generate a unique invoice number, every time i open it, and then the vendor will mention the customer's info, product's info and click on submit button or save it. The info mentioned in the invoice will automatically be saved in the MS-Access database whenever submit button is clicked or the document is saved.
Thus, All the records of the customer will be saved in the MS-Access database. whenever i need to search for a particular customer, i should be able to search it from either invoice no. or any unique field for that particular invoice. I hope my query is explained clearly. please let me know the easiest way to do it. I do not have the vast knowledge about this subject, so give me suggestions that are understandable by a Novice.
I think you are starting from the wrong end. Use an Access form to get the data and then run a mailmerge, the easiest way is to output a text file from Access as the data file and use a Word template for the merge.
An autonumber may suit for invoice number as long as all you need is a unique number. If you need documented sequential numbers, you will have to create then yourself. How you do it will depend on the number of users working at the same time.
I can tell you now, generating Word files with Access is a bit of a pain in the ass. If you really want to do formatting it gets hard (is my experience).
I ended up generating HTML files in which I could control everything, and opening them as .docs. But if you are really new to this, I suggest you start with some VBA tutorials, where they explain to you how you get records from you database and loop through them to generate output. And then you can start looking at file writing functions in VBA.
Can't find any tutorials real quick (my girlfriend is getting angry as we speak), but here is a sample:
http://www.access-programmers.co.uk/forums/showthread.php?t=25354
Just look around in fora, look for file generation and looping through records.
Hi just reading your post, like Remou l would strongly suggest you use Access to enter and store the data. It is possible to get a user to enter data into a spreadsheet and write the data back to Access DB. Not something l would recommend for the novice, here is a link to some code on how it could be done
Returning to your first question, of creating the invoice have you considered generating the invoices from Access using a report? They can be printed to PDF, or exported to various electronic formats. Or is there specific reason to use Word/Excel? If are going down the route of using Word to generate the invoice then use a template as Remou suggested. See this link for some samples see the section titled Access > Word. I have used the examples as a basis for Access to Word. A number of the examples though use a tecnology called DAO, which l understand will not be included in any operating system after Windows 7. Just something to be aware of.
Searching for a record in a database table this link has one possible solution . Also the author has included a example database.

Resources