Need help wih Lotus Notes automation

  • Thread starter Nick via AccessMonster.com
  • Start date
N

Nick via AccessMonster.com

Hello all,

I need some help with my Lotus Notes automation, specifically the Automatic
Signature; this seems like it should be a fairly simple question but I can
find no documentation about this particular area.

I am using VBA to create an e-mail through Lotus Notes, and I had it working
fine on my machine (No automatic signature). I moved the application to
another machine, and the guy on the other machine has a signature
automatically added to all e-mails. The problem is that the signature is at
the beginning of the e-mail; the body text of the e-mail ends up looking like:


(Insert signature here)New kits have been added...

Is there a fix/workaround to this? Like a way to turn off the signature and
append it through code, or a way to detect the sig and cut and paste it
through code? Any help/guidance you all could give would be great.

Thanks very much in advance,
Nick
 
K

Kevin K. Sullivan

Nick,

Unfortunately, you did not show the VBA code you use, so I'm guessing in
the dark. The way Notes works is particular to your mail template, so I
won't try to guess about it. I'm just wondering if you have the
equivalent of the following happening.

-you create a NOTESDOCUMENT
-the mail template places the sig text into the Body field
-you append your text to the end of the body

The solution in this case is to:
-you create a NOTESDOCUMENT
-the mail template places the sig text into the Body field
-save the existing Body text into a string variable, strExistingBody
-set Body field to strYourText & strExistingBody

Again, post your VBA code if you want more specific help.

HTH,

Kevin
 
N

Nick via AccessMonster.com

Kevin,

Thanks for the reply. Below is some of my code... I don't know how much you
need and I have to go to a meeting in a minute so I will give you the
problematic area. Your suggestion makes sense... I am just having trouble
implementing it.

Set MailDoc = maildb.CREATEDOCUMENT

MailDoc.Form = "Memo"
MailDoc.SIGNONSEND = False 'Does
not help
MailDoc.Subject = Subject

MailDoc.SIGNATURE = ""
'Does not help
MailDoc.Body = ""
'Will not clear out the signature
MailDoc.Body = strBodyText

I guess my question is - should I be using something other than MailDoc.Body?
I wondered if .Body might not include the signature, if it would be
controlled by another area... I'm sorry if this makes no sense, I am kind of
stumbling along trying to understand the signature aspect.

If you want the full module, please let me know and I will clean it up and
post it soon.

Thanks again for the help.

Nick
 
N

Nick via AccessMonster.com

Bleh - sorry about the bad formatting on that code. I forgot about the width
restriction

MailDoc.Form = "Memo"
MailDoc.SIGNONSEND = False 'Does not help
MailDoc.Subject = Subject

MailDoc.SIGNATURE = "" 'Does not help
MailDoc.Body = "" 'Will not clear out the signature
MailDoc.Body = strBodyText


Nick
 
K

Kevin K. Sullivan

Nick,

I'm afraid I don't know what else to advise from a VBA perspective. It
looks like you'll need to consult your Notes admin about how the sig is
added.

Kevin
 
N

Nick via AccessMonster.com

No worries - the work I'm doing is just a push to start increasing use of
Access and supported automation like Notes and Excel. I ended up just
working around the problem, I added 2 carriage return/line feeds before the
body text, so at least the text is still set apart. And the people who saw
the demonstration were impressed (which was the important part) Thanks
anyways for your help.

Nick
 
Joined
Mar 5, 2011
Messages
2
Reaction score
0
Hi ppl,

I have been at this problem for ages....haiz...1 last part to go & did not realize it can be so hard...These are what I need to do & hope someone can help!!!

WHAT THE CURRENT MACRO DOES

1. I have an excel spreadsheet which records (1) Email Address in Col A, (2) Subject in Col B, (3) Email body in Col C
2. Activating the macro sends out an the same email (in Col C) to all recipients in Col A by running through a For Loop
3. The purpose of this is to send out mass LN to 'x' number of recipients such that each of this recipient only sees himself as the recipient instead of himself as part of an entire list - The body of the email will need to be customized uniquely to each recipient --> therefore the need to run this macro
BUT until the signature file is attached, we are unable to release the usage of this macro...arghh...more details below:

PROBLEMS - WHAT MACRO DOES NOT DO

1. I need to append Signature File at the bottom of each email that is sent out
1. This Signature File is like our name 'Thanks and Best Regards, Daniel, VP' together with a banner / picture file
2. I have saved this Signature as a 'Web Page, Filtered (*.htm; *.html)
3. After that, I go to Lotus Notes --> Tools --> Preferences --> Select Signature --> Check HTML or Image File --> Select the htm file from Step 2 above
2. Also, the current macro is unable to record the sent mails in 'Sent Mails' unless i change a line in the macro to "Set Maildb = Session.GETDATABASE("", "") such that the user just clicks the macro and will open the default LN that is open. BUT what I am doing now is the get a 3rd party 'y' to send out the mass LN in the name of the person 'X'. For this, i switched the lotus notes ID to person 'X' & changed the line in the macro to "Set Maildb = Session.GETDATABASE("", "C:\archive file of person X.nsf"). Then I'm able to send out as 'y' BUT the mails do not get recorded in my sent mails

THE CURRENT MACRO CODE (WITH HELP MANY OTHER VBA GURUS ONLINE!!!)

Sub SendLN()
Dim Maildb As Object
Dim Maildoc As Object
Dim Body As Object
Dim Session As Object
Dim i As Integer
Dim objNotesDocument As Object
Dim objNotesField As Object
For i = 2 To 3
' Because the 1st row is the heading
Set Session = CreateObject("Lotus.NotesSession")
CallSession.Initialize ("password of person sending out LN")
Set Maildb = Session.GETDATABASE("", "C:\lotus notes id of user.nsf")
If Not Maildb.IsOpen = True Then Call Maildb.Open
Set Maildoc = Maildb.CREATEDDOCUMENT
Call Maildoc.REPLACEITEMVALUE("Form", "Memo")
Call Maildoc.REPLACEITEMVALUE("SendTo", Cells(i, 1).Value)
Call Maildoc.REPLACEITEMVALUE("Subject", Cells(i, 2).Value)
Set objNotesSession = CreateObject("Notes.NotesSession")
Set objNotesMailFile = objNotesSession.GETDATABASE(",")
objNotesMailFile.OPENMAIL
Set objNotesDocument = objNotesMailFile.CREATEDDOCUMENT
Set objNotesField = objNotesDocument.APPENDITEMVALUE("CopyTo", EmailCCTo)
EmailCCTo = "person whom is supposed to be CCed"
Set Body = Maildoc.CREATERICHTEXTITEM("Body")
Call Body.APPENDTEXT(Cells(2, 3).Value)
Call Body.ADDNEWLINE(2)
Call Body.EMBEDOBJECT(1454, "", "C:\directory to store the files" & Cells(i, 4).Value & ".doc", "Attachment")
Maildoc.SAVEMESSAGEONSEND = True
Call Maildoc.REPLACEITEMVALUE("PosteDate", Now())
Call Maildoc.SEND(False)
Set Maildb = Nothing
Set Maildoc = Nothing
Set Body = Nothing
Set Session = Nothing
Next i
End Sub

MY CURRENT FINDINGS SO FAR

1. The htm file is a rich text file that we need to somehow get the VBA to transport into Lotus Notes but I am totally stuck as cant' seem to find any posting on this
2. The reason why I need this is because I also have a picture (a banner to be shown below my name at the bottom of every email I send out )--> so I cannot subsitute by just typing it as part of the body text. I also need to colour & bold my name in red
3. I am not restricting to using signature --> if there are other good subsitutes that give the same result (a lot of times, some VBA geniuses will come up with an ingenious method...hope I can get some help here!)
4. The 'Sent Items' are actually written into the code above but does not seem to work if I am using the 3rd party method
Hope someone has some idea on this!! Especially the signature portion!!! It's a big headache & I do not seem to find any standard coding like the attachment 1454 method.. I hope to write the macro in such a way that it will pick up the html file (I can put them in a location easy to pick up). Hope some1 can help on this. .Thanks!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top