emailing reports and mail merges etc

retrieve

New member
Local time
Today, 22:39
Joined
Sep 30, 2004
Messages
6
Hi,

I have been trying to email a report from a form in rtf format. As many of the posts discuss - its better to use a mail merge to keep formatting, graphics together etc. I only have text boxes on my form and have two larger fields that have 'can grow' set to yes. when the report is converted to rtf some of these larger fields are truncated.

I have tried to remedy this by making the fields larger, removing bold etc etc. I am still getting knowhere fast so have tried to alter some code i found and it doesn't work. I'm not a programmer so have no idea what I am doing....

Help would be greatly appreciated! :confused:

Cath

ps here is the code so far - It doesn't get past the third line, let alone the rest of it....


Private Sub MergeButton_Click()
On Error GoTo MergeButton_Err
Dim objWord As Word.Application
'Start Microsoft Word 97.
Set objWord = CreateObject("Word.Application")
With objWord
'Make the application visible.
.Visible = True
'Open the document.
.Documents.Open ("U:\FLR\SHARED-FLR3-A\Pdg\Pdg Data\wdfiles\80000\80232\Technical Assistant\Tender Queries\DMSMerge.doc")
'Move to each bookmark and insert text from the form.
.ActiveDocument.Bookmarks("Date").Select
.Selection.Text = (CStr(Froms![Consultant Query]![Actual Date]))

End With
'Print the document in the foreground so MS Word 97 wont close until the doc
'finishes printing.
objWord.ActiveDocument.PrintOut Background:=False
'Close the document without saving changes.
objWord.ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
'Quit MS Word 97 and release the object variable.
objWord = Nothing
Exit Sub
MergeButton_Err:
'If a field on the form is empty
'remove the bookmark text and continue.
If Err.Number = 94 Then
objWord.Selection.Text = ""
Resume Next
Else
MsbBox Err.Number & vbCr & Err.Description
End If
Exit Sub
End Sub
 
I haven't done mail merges to Word, but if it hangs on the 3rd line, it's probably because you don't have the Word library checked in Tools/References.

Another thought though. Have you considered exporting in Snapshot format, which retains all formatting?
 
snapshot...

Hi,

I have tried using snapshot...how do recipients view the file? If I email it to myself I can't open it either ... not sure what to associate it with?

C
 
how to automatically format data from mailmerge???

Hi,

I have several mail merge documents using access and word to transfer the data.

Is there anyway that I can automatically edit, (i.e. bold or omit zero's from long numbers), the merged data?

Please help!

Jay :confused:
 

Users who are viewing this thread

Back
Top Bottom