Hi I have written code to output a report and add to lotus notes and send.
The only problem is that when the report output rich text, so i lose all the details like checkboxes, field boxes, logo etc.
I have used the following code.
Code: ( vb )
Public Function SendNotesMail() - Dim strDocName As String
-
strDocName = mailing_list
-
DoCmd.OpenQuery "query1"
-
-
DoCmd.OpenQuery "query2"
-
'Set up the objects required for Automation into lotus notes
-
'Set dbs = CurrentDb
-
Dim rst As Object
-
Dim rat As Object
-
Dim Maildb As Object 'The mail database
-
Dim UserName As String 'The current users notes name
-
Dim MailDbName As String 'THe current users notes mail database name
-
Dim MailDoc As Object 'The mail document itself
-
Dim AttachME As Object 'The attachment richtextfile object
-
Dim Session As Object 'The notes session
-
Dim EmbedObj As Object 'The embedded object (Attachment)
-
Dim copyTo(250) As Variant
-
'
-
Set rst = CurrentDb.OpenRecordset("mailing_list")
-
-
With rst
-
-
.MoveFirst 'go to the first record
-
-
strAddress = .Fields(1).Value
-
-
.MoveNext 'get all subsequent addresses and separate each with a semi-colon
-
strBcc = strAddress
-
Do While .EOF = False
-
strAddress = .Fields(1).Value
-
'*** Replace "EMailAddress" with the name of your field
-
strBcc = strBcc & ", " & strAddress
-
.MoveNext
-
Loop
-
End With
-
Set rat = CurrentDb.OpenRecordset("email_detail_table")
-
-
With rat
-
-
.MoveFirst 'go to the first record
-
-
strsbj1 = .Fields(0).Value
-
strsbj2 = .Fields(1).Value
-
strsbj3 = .Fields(2).Value
-
strsbj4 = .Fields(3).Value
-
strsbj5 = .Fields(4).Value
-
strsbjM = "POL" & strsbj1 & " " & strsbj2 & " " & strsbj3 & " " & strsbj4
-
-
End With
-
-
DoCmd.OutputTo acOutputReport, "current_form_report", acFormatTXT, "S:\BSM\System Operations Team\Live Service Team\OCP Information\POL OCP\" & "POL" & strsbj1 & ".doc", False
-
'Start a session to notes
-
Set Session = CreateObject("Notes.NotesSession")
the line in question is 51. I have tried acFormatTXT and acFormatDOC and acFormatRTF in each functions i lose all my boxes etc any help please as the report looks garbage. I know there is a way round this as other firms use access to send automated reports, but i cant figure it out. I have tried microsoft who say tough titties and i googled it hundred of times help me please
2 4106
Hi I have written code to output a report and add to lotus notes and send.
The only problem is that when the report output rich text, so i lose all the details like checkboxes, field boxes, logo etc.
I have used the following code.
Code: ( vb )
Public Function SendNotesMail() - Dim strDocName As String
-
strDocName = mailing_list
-
DoCmd.OpenQuery "query1"
-
-
DoCmd.OpenQuery "query2"
-
'Set up the objects required for Automation into lotus notes
-
'Set dbs = CurrentDb
-
Dim rst As Object
-
Dim rat As Object
-
Dim Maildb As Object 'The mail database
-
Dim UserName As String 'The current users notes name
-
Dim MailDbName As String 'THe current users notes mail database name
-
Dim MailDoc As Object 'The mail document itself
-
Dim AttachME As Object 'The attachment richtextfile object
-
Dim Session As Object 'The notes session
-
Dim EmbedObj As Object 'The embedded object (Attachment)
-
Dim copyTo(250) As Variant
-
'
-
Set rst = CurrentDb.OpenRecordset("mailing_list")
-
-
With rst
-
-
.MoveFirst 'go to the first record
-
-
strAddress = .Fields(1).Value
-
-
.MoveNext 'get all subsequent addresses and separate each with a semi-colon
-
strBcc = strAddress
-
Do While .EOF = False
-
strAddress = .Fields(1).Value
-
'*** Replace "EMailAddress" with the name of your field
-
strBcc = strBcc & ", " & strAddress
-
.MoveNext
-
Loop
-
End With
-
Set rat = CurrentDb.OpenRecordset("email_detail_table")
-
-
With rat
-
-
.MoveFirst 'go to the first record
-
-
strsbj1 = .Fields(0).Value
-
strsbj2 = .Fields(1).Value
-
strsbj3 = .Fields(2).Value
-
strsbj4 = .Fields(3).Value
-
strsbj5 = .Fields(4).Value
-
strsbjM = "POL" & strsbj1 & " " & strsbj2 & " " & strsbj3 & " " & strsbj4
-
-
End With
-
-
DoCmd.OutputTo acOutputReport, "current_form_report", acFormatTXT, "S:\BSM\System Operations Team\Live Service Team\OCP Information\POL OCP\" & "POL" & strsbj1 & ".doc", False
-
'Start a session to notes
-
Set Session = CreateObject("Notes.NotesSession")
the line in question is 51. I have tried acFormatTXT and acFormatDOC and acFormatRTF in each functions i lose all my boxes etc any help please as the report looks garbage. I know there is a way round this as other firms use access to send automated reports, but i cant figure it out. I have tried microsoft who say tough titties and i googled it hundred of times help me please
Hi,
From the Access help file for "OutputTo"
For a control bound to a Yes/No field (a toggle button, option button, or check box), the output file displays the value –1 (Yes) or 0 (No).
I think what you will have to do is design the report in Design view then open it based on a recordset/query that you build in code. You could then use the "SendObject" action.
Jim
Hi,
From the Access help file for "OutputTo"
I think what you will have to do is design the report in Design view then open it based on a recordset/query that you build in code. You could then use the "SendObject" action.
Jim
I have designed the report but i do not understand what u mean. I use the send to function to send the report to lotus notes. the problem I have is with how the report outputs itself it doesnt recognise DOC command and sends it a RTF which gets rid of all the actual true formating. Could u explain further what u mean?
Does it matter if the report doesn't open before it outputs it, I run a query to return the report, which it then saves to a destination folder using a string to poulate the name, so i am confused by what u mean when u say open the recordset and sendto
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Anne |
last post by:
Hi NG
I have made a report in access, and i have used the OutPutTo to transfer it
to word (rft format). It is a letter with addressheader, date, sign etc. The
user should always add something in...
|
by: Mal |
last post by:
Hi,
I have a button on a form that outputs a report to word.
While it has been working well for a while, today it is not.
The behaviour now is that it endlessly outputs pages to word. There...
|
by: Mark C |
last post by:
All,
I have exhaustingly been looking through the newsgroups in search of a way
to systemically output an Access 97 report to a pdf file using the full
version of Adobe Acrobat. I want the user...
|
by: Jorge Cecílio |
last post by:
Hi!
I would like to export some MS-Access reports output to pdf.
However, the only possibility offered by Access (afaik) for me to export
formatted output is snp (snapshot) (I use MS-Office...
|
by: Trevor Best |
last post by:
I have a report that's fairly simple, page headers and footers, detail
has a subreport in (can vary in length). The customer wanted a signature
block for them, their client and 3rd party. This was...
|
by: Galina |
last post by:
Hello
All of a sudden I started getting error 13, type mismatch in a
command, which was running happily for years. Here is a code:
Option Compare Database
Option Explicit
Dim CmdClose1_Clicked...
|
by: Ryan |
last post by:
I am writing a VB (2005) program that will allow the user to fill out and
print a form. The form input is stored in a database (SQL 2005) to be
retrieved/viewed/printed later. The form is...
|
by: pv1 |
last post by:
Hello,
I am somewhat new to Access and vba, but am trying to complete a request that has been made of me. Access version 2002 WindowsXP.
At this point these text boxes are bound to the table...
|
by: sara |
last post by:
Hi -
I have a report that is 14 columnar sub-reports (Line up: Position-
holders in each of our 14 locations - Manager, Assistant Manager,
Receiving, Office, etc).
I output directly to PDF...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |