Paste Address values to new Word Document

whitesmoke

Registered User.
Local time
Today, 00:09
Joined
Jun 23, 2006
Messages
29
Hi. . I can't really find anything related to what i need.

I need to be able copy a current records field values, load up a blank word document and place or paste the field values to the document.

My user does not want to hassle with mail merge, they just want to be able to get the current records data to a document for editing.

Thanks in advance for any assistance or direction.
 
ok i managed find something to work with with at least do it with a template.. but it's only entering the last field can anyone see what i'm doing wrong
code is below. thanks anyone!!

Dim objWord As Word.Application
'Start Microsoft Word 2000.
Set objWord = CreateObject("Word.Application")

With objWord
'Make the application visible.
.Visible = False

'path and name of the template your are using.

.Documents.Open("D:\Letter.doc").SaveAs ("D:\Letter_" & Me.Company & ".doc")

'This is for the bookmark that you created in the template

.Selection.Text = [CCodeName]
.Selection.Text = IIf(IsNull([Address1]), "", Me.Address1)
.Selection.Text = IIf(IsNull([City]), "", [City])
.Selection.Text = IIf(IsNull([cboEmpID]), "", cboEmpID.Column(0))

End With

Print_Reconsideration_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

End If
objWord.Application.Options.PrintBackground = False
objWord.Documents.Open ("D:\Letter_" & Customer & ".doc")
 

Users who are viewing this thread

Back
Top Bottom