Group:  Microsoft Access ยป microsoft.public.access.modulescoding
Thread: DoCmd.OutputTo

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

DoCmd.OutputTo
Jose Perdigao 17.09.2006 13:51:01
I'm using ms access 2003 (ADP) vs SQL Server.

I created a module using the method DoCmd.OutputTo to export a view to Ms
Word.

It works fine, but it needs improvement. I have two questions.

1. The columns width is not properly. I would like increase the column with.
How can I do programmatically?
2. I would like create a Template with the logo and landscape format and
then export to it. How can I do? Or if is possible, I would Like create the
headers in a template and the export to it.

Thanks for your suggestions.

Re: DoCmd.OutputTo
"Arvin Meyer [MVP]" <a[ at ]m.com> 19.09.2006 01:27:34
"Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message
news:3EB09C54-FECD-4574-850B-4BA16510EAD8[ at ]microsoft.com...
[Quoted Text]
> I'm using ms access 2003 (ADP) vs SQL Server.
>
> I created a module using the method DoCmd.OutputTo to export a view to Ms
> Word.
>
> It works fine, but it needs improvement. I have two questions.
>
> 1. The columns width is not properly. I would like increase the column
> with.
> How can I do programmatically?

Word.Range.Columns(1).Width = 50
Word.Range.Columns(2).Width = 325
Word.Range.Columns(3).Width = 125

> 2. I would like create a Template with the logo and landscape format and
> then export to it. How can I do? Or if is possible, I would Like create
> the
> headers in a template and the export to it.

http://www.datastrat.com/Code/WordMerge.txt
--
Arvin Meyer, MCP, MVP
Free MS-Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Re: DoCmd.OutputTo
Jose Perdigao 19.09.2006 07:37:01
I wrote the following code:

Dim stDoc As String

stDoc = "P5_CmtsOIM"
DoCmd.OutputTo acOutputServerView, stDoc, acFormatRTF, "Cmts.doc", True
Word.Range.Columns(1).Width = 50
Word.Range.Columns(2).Width = 325
Word.Range.Columns(3).Width = 125

This code gives run time error (424) object required.
How can I relate word.range for the word document that was opened by
docmd.outputto?

Thanks
JP
"Arvin Meyer [MVP]" wrote:

[Quoted Text]
> "Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message
> news:3EB09C54-FECD-4574-850B-4BA16510EAD8[ at ]microsoft.com...
> > I'm using ms access 2003 (ADP) vs SQL Server.
> >
> > I created a module using the method DoCmd.OutputTo to export a view to Ms
> > Word.
> >
> > It works fine, but it needs improvement. I have two questions.
> >
> > 1. The columns width is not properly. I would like increase the column
> > with.
> > How can I do programmatically?
>
> Word.Range.Columns(1).Width = 50
> Word.Range.Columns(2).Width = 325
> Word.Range.Columns(3).Width = 125
>
> > 2. I would like create a Template with the logo and landscape format and
> > then export to it. How can I do? Or if is possible, I would Like create
> > the
> > headers in a template and the export to it.
>
> http://www.datastrat.com/Code/WordMerge.txt
> --
> Arvin Meyer, MCP, MVP
> Free MS-Access downloads:
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
>
>
>
Re: DoCmd.OutputTo
Jose Perdigao 19.09.2006 08:10:02
Hy Arvin,

I tried to use your code (cmdMergeLetter_Click) but I couldn't. I download
your file DocMgr_2K.mdb also I could work with it or I don't know how can i
use.

Could you give a small example? For example, form the Northwind database,
how can I export to word document the table EmpNotes? We have two columns
(empName; Comments). I would like for example Columns widths 4cm; 11cm).

If I create a Word Document (template) where already exist columns names,
how can I export the table for this document?

Thanks a lot.

JP


"Arvin Meyer [MVP]" wrote:

[Quoted Text]
> "Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message
> news:3EB09C54-FECD-4574-850B-4BA16510EAD8[ at ]microsoft.com...
> > I'm using ms access 2003 (ADP) vs SQL Server.
> >
> > I created a module using the method DoCmd.OutputTo to export a view to Ms
> > Word.
> >
> > It works fine, but it needs improvement. I have two questions.
> >
> > 1. The columns width is not properly. I would like increase the column
> > with.
> > How can I do programmatically?
>
> Word.Range.Columns(1).Width = 50
> Word.Range.Columns(2).Width = 325
> Word.Range.Columns(3).Width = 125
>
> > 2. I would like create a Template with the logo and landscape format and
> > then export to it. How can I do? Or if is possible, I would Like create
> > the
> > headers in a template and the export to it.
>
> http://www.datastrat.com/Code/WordMerge.txt
> --
> Arvin Meyer, MCP, MVP
> Free MS-Access downloads:
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
>
>
>
Re: DoCmd.OutputTo
Jose Perdigao 19.09.2006 08:33:03
Again Arvin,

I check your file EmailSenate2K.mdb. I have a question, I don't know if i
can do in this post.

Could you help me how can I send a file external?
Thanks a lot.

"Arvin Meyer [MVP]" wrote:

[Quoted Text]
> "Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message
> news:3EB09C54-FECD-4574-850B-4BA16510EAD8[ at ]microsoft.com...
> > I'm using ms access 2003 (ADP) vs SQL Server.
> >
> > I created a module using the method DoCmd.OutputTo to export a view to Ms
> > Word.
> >
> > It works fine, but it needs improvement. I have two questions.
> >
> > 1. The columns width is not properly. I would like increase the column
> > with.
> > How can I do programmatically?
>
> Word.Range.Columns(1).Width = 50
> Word.Range.Columns(2).Width = 325
> Word.Range.Columns(3).Width = 125
>
> > 2. I would like create a Template with the logo and landscape format and
> > then export to it. How can I do? Or if is possible, I would Like create
> > the
> > headers in a template and the export to it.
>
> http://www.datastrat.com/Code/WordMerge.txt
> --
> Arvin Meyer, MCP, MVP
> Free MS-Access downloads:
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
>
>
>
Re: DoCmd.OutputTo
"Arvin Meyer [MVP]" <a[ at ]m.com> 20.09.2006 00:24:40
You haven't dimmed a Word object or set a reference to it. Here's some code
that I wrote more than 3 years ago. You'll need to set a reference to Word.
It is well commented, but you must understand ADO coding to use it. Watch
out for line wrapping:

Private Sub MergeWorkTicket()
On Error GoTo Err_MergeWorkTicket

Dim WordTemplate As String
Dim strFullName As String
Dim objWord As Word.Application
Dim objDoc As Word.Document
Dim strSQL As String
Dim cnnConnection As ADODB.Connection
Dim comCommand As ADODB.Command
Dim rs As ADODB.Recordset
Dim strConnect As String

' ADO Recordset of the parts list on the work order
strSQL = "SELECT tblPartsList.PartQuantity As QTY,
tblPartsList.PartDescription As DESCRIPTION, tblPartsList.PartSerialNumber
As SERIAL# "
strSQL = strSQL & "FROM tblWorkOrder INNER JOIN tblPartsList ON
tblWorkOrder.WorkOrderNumber = tblPartsList.WorkOrderNumber "
strSQL = strSQL & "WHERE tblPartsList.WorkOrderNumber = " &
Forms!frmWorkOrder!txtWorkOrderNumber

strConnect = "Provider=SQLOLEDB;Data Source=Neptune;" & _
"Initial Catalog=TheDBName;" & _
"User ID=SA;password=Whatever"

Set cnnConnection = New ADODB.Connection

cnnConnection.Open strConnect

Set comCommand = New ADODB.Command

'Debug.Print strSQL

' Assign the connection and set applicable properties
comCommand.ActiveConnection = cnnConnection
comCommand.CommandText = strSQL
comCommand.CommandType = adCmdText

' Instantiate the recordset
Set rs = New ADODB.Recordset

' Open the recordset using the command object
rs.Open comCommand 'rs.Open comCommand, , adOpenKeyset, adLockOptimistic

Set objWord = CreateObject("Word.Application")


WordTemplate = Application.CurrentProject.Path & "\WorkTicket.dot"

With objWord
.Visible = True
.Documents.Add (WordTemplate)
.Caption = "Work Ticket For " & Me.cboAccountID.Column(1) & ""

' If document is protected, Unprotect it.
If .ActiveDocument.ProtectionType <> wdNoProtection Then
.ActiveDocument.Unprotect Password:=""
End If

.ActiveDocument.Bookmarks("Customer").Select
.Selection.Text = (CStr(Me.cboAccountID.Column(1)))
.ActiveDocument.Bookmarks("Address").Select
.Selection.Text = (CStr(Me.cboAccountID.Column(2)))
.ActiveDocument.Bookmarks("City").Select
.Selection.Text = (CStr(Me.cboAccountID.Column(3)))
.ActiveDocument.Bookmarks("State").Select
.Selection.Text = (CStr(Me.cboAccountID.Column(4)))
.ActiveDocument.Bookmarks("Zip").Select
.Selection.Text = (CStr(Me.cboAccountID.Column(5)))
.ActiveDocument.Bookmarks("Phone").Select
.Selection.Text = (CStr(Me.cboAccountID.Column(8)))
.ActiveDocument.Bookmarks("DateScheduled").Select
.Selection.Text = (Format$(Me.txtDateScheduled, "m/d/yy")) & " " &
(Format$(Me.txtScheduledStartTime, "h:nn AM/PM"))
.ActiveDocument.Bookmarks("ContactName").Select
.Selection.Text = (CStr(txtWorkOrderContact & vbNullString))
.ActiveDocument.Bookmarks("Fax").Select
.Selection.Text = (CStr(Me.cboAccountID.Column(9)))
.ActiveDocument.Bookmarks("WorkOrder").Select
.Selection.Text = (CStr(Me.txtInvoiceNumber))
.ActiveDocument.Bookmarks("Problem").Select
.Selection.Text = (CStr(Me.txtProblemOrService & vbNullString))
.ActiveDocument.Bookmarks("Tech").Select
.Selection.Text = (CStr(Me.cboScheduledTech.Column(1) &
vbNullString))

' Debug.Print rs.RecordCount
If Not rs.BOF And Not rs.EOF Then
With CreateTableFromRst( _
objWord.ActiveDocument.Bookmarks("ItemDetails").Range, rs,
False)

'Apply formatting
.Range.Columns(1).Width = 29
.Range.Columns(2).Width = 337
.Range.Columns(3).Width = 140

objWord.Selection.MoveDown
End With
End If

' Cleanup
Set objWord = Nothing

End With

Exit_MergeWorkTicket:
Exit Sub

Err_MergeWorkTicket:
MsgBox Err.Number & ": " & Err.Description, vbInformation, "Error"
Resume Exit_MergeWorkTicket

End Sub

Function CreateTableFromRst( _
rngAny As Word.Range, _
rstAny As ADODB.Recordset, _
Optional fIncludeFieldNames As Boolean = False) _
As Word.Table

Dim objTable As Word.Table
Dim fldAny As ADODB.Field
Dim varData As Variant
Dim strBookmark As String
Dim cField As Long

' Get the data from the recordset
varData = rstAny.GetString()

' Create the table
With rngAny

' Creating the basic table is easy,
' just insert the tab-delimted text
' add convert it to a table
.InsertAfter varData
Set objTable = .ConvertToTable()

End With

Set CreateTableFromRst = objTable
End Function
--
Arvin Meyer, MCP, MVP
Free MS-Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message
news:A05DD86D-E406-4EDE-8BC7-639DF0BD5055[ at ]microsoft.com...
[Quoted Text]
>I wrote the following code:
>
> Dim stDoc As String
>
> stDoc = "P5_CmtsOIM"
> DoCmd.OutputTo acOutputServerView, stDoc, acFormatRTF, "Cmts.doc", True
> Word.Range.Columns(1).Width = 50
> Word.Range.Columns(2).Width = 325
> Word.Range.Columns(3).Width = 125
>
> This code gives run time error (424) object required.
> How can I relate word.range for the word document that was opened by
> docmd.outputto?
>
> Thanks
> JP
> "Arvin Meyer [MVP]" wrote:
>
>> "Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message
>> news:3EB09C54-FECD-4574-850B-4BA16510EAD8[ at ]microsoft.com...
>> > I'm using ms access 2003 (ADP) vs SQL Server.
>> >
>> > I created a module using the method DoCmd.OutputTo to export a view to
>> > Ms
>> > Word.
>> >
>> > It works fine, but it needs improvement. I have two questions.
>> >
>> > 1. The columns width is not properly. I would like increase the column
>> > with.
>> > How can I do programmatically?
>>
>> Word.Range.Columns(1).Width = 50
>> Word.Range.Columns(2).Width = 325
>> Word.Range.Columns(3).Width = 125
>>
>> > 2. I would like create a Template with the logo and landscape format
>> > and
>> > then export to it. How can I do? Or if is possible, I would Like create
>> > the
>> > headers in a template and the export to it.
>>
>> http://www.datastrat.com/Code/WordMerge.txt
>> --
>> Arvin Meyer, MCP, MVP
>> Free MS-Access downloads:
>> http://www.datastrat.com
>> http://www.mvps.org/access
>> http://www.accessmvp.com
>>
>>
>>


Re: DoCmd.OutputTo
Jose Perdigao 20.09.2006 09:54:02
Good morning Arvin,

I set reference to Word; I understand ADO, DAO, VBA and automation basically
for excel.

I read your code and I tried to apply for my database and doesn't work.

When I run comes the following message: method or data not found. I think it
refers any control (Me.cboAccountID). Where is this control? This is a column
name in the word? When we refer ME, it means is a control in a form and the
procedure should be in the form. I don't understand this. Could you explain?

I think, the first step is creating a template.dot with a table with columns
number same recordset fields number, is it right?
Then, create book marks in the word, we must give the same names of the
fields in the recordset, is right?

I'm confused about this procedure.

I'll appreciate a lot for your help.

Thanks a lot




"Arvin Meyer [MVP]" wrote:

[Quoted Text]
> You haven't dimmed a Word object or set a reference to it. Here's some code
> that I wrote more than 3 years ago. You'll need to set a reference to Word.
> It is well commented, but you must understand ADO coding to use it. Watch
> out for line wrapping:
>
> Private Sub MergeWorkTicket()
> On Error GoTo Err_MergeWorkTicket
>
> Dim WordTemplate As String
> Dim strFullName As String
> Dim objWord As Word.Application
> Dim objDoc As Word.Document
> Dim strSQL As String
> Dim cnnConnection As ADODB.Connection
> Dim comCommand As ADODB.Command
> Dim rs As ADODB.Recordset
> Dim strConnect As String
>
> ' ADO Recordset of the parts list on the work order
> strSQL = "SELECT tblPartsList.PartQuantity As QTY,
> tblPartsList.PartDescription As DESCRIPTION, tblPartsList.PartSerialNumber
> As SERIAL# "
> strSQL = strSQL & "FROM tblWorkOrder INNER JOIN tblPartsList ON
> tblWorkOrder.WorkOrderNumber = tblPartsList.WorkOrderNumber "
> strSQL = strSQL & "WHERE tblPartsList.WorkOrderNumber = " &
> Forms!frmWorkOrder!txtWorkOrderNumber
>
> strConnect = "Provider=SQLOLEDB;Data Source=Neptune;" & _
> "Initial Catalog=TheDBName;" & _
> "User ID=SA;password=Whatever"
>
> Set cnnConnection = New ADODB.Connection
>
> cnnConnection.Open strConnect
>
> Set comCommand = New ADODB.Command
>
> 'Debug.Print strSQL
>
> ' Assign the connection and set applicable properties
> comCommand.ActiveConnection = cnnConnection
> comCommand.CommandText = strSQL
> comCommand.CommandType = adCmdText
>
> ' Instantiate the recordset
> Set rs = New ADODB.Recordset
>
> ' Open the recordset using the command object
> rs.Open comCommand 'rs.Open comCommand, , adOpenKeyset, adLockOptimistic
>
> Set objWord = CreateObject("Word.Application")
>
>
> WordTemplate = Application.CurrentProject.Path & "\WorkTicket.dot"
>
> With objWord
> .Visible = True
> .Documents.Add (WordTemplate)
> .Caption = "Work Ticket For " & Me.cboAccountID.Column(1) & ""
>
> ' If document is protected, Unprotect it.
> If .ActiveDocument.ProtectionType <> wdNoProtection Then
> .ActiveDocument.Unprotect Password:=""
> End If
>
> .ActiveDocument.Bookmarks("Customer").Select
> .Selection.Text = (CStr(Me.cboAccountID.Column(1)))
> .ActiveDocument.Bookmarks("Address").Select
> .Selection.Text = (CStr(Me.cboAccountID.Column(2)))
> .ActiveDocument.Bookmarks("City").Select
> .Selection.Text = (CStr(Me.cboAccountID.Column(3)))
> .ActiveDocument.Bookmarks("State").Select
> .Selection.Text = (CStr(Me.cboAccountID.Column(4)))
> .ActiveDocument.Bookmarks("Zip").Select
> .Selection.Text = (CStr(Me.cboAccountID.Column(5)))
> .ActiveDocument.Bookmarks("Phone").Select
> .Selection.Text = (CStr(Me.cboAccountID.Column(8)))
> .ActiveDocument.Bookmarks("DateScheduled").Select
> .Selection.Text = (Format$(Me.txtDateScheduled, "m/d/yy")) & " " &
> (Format$(Me.txtScheduledStartTime, "h:nn AM/PM"))
> .ActiveDocument.Bookmarks("ContactName").Select
> .Selection.Text = (CStr(txtWorkOrderContact & vbNullString))
> .ActiveDocument.Bookmarks("Fax").Select
> .Selection.Text = (CStr(Me.cboAccountID.Column(9)))
> .ActiveDocument.Bookmarks("WorkOrder").Select
> .Selection.Text = (CStr(Me.txtInvoiceNumber))
> .ActiveDocument.Bookmarks("Problem").Select
> .Selection.Text = (CStr(Me.txtProblemOrService & vbNullString))
> .ActiveDocument.Bookmarks("Tech").Select
> .Selection.Text = (CStr(Me.cboScheduledTech.Column(1) &
> vbNullString))
>
> ' Debug.Print rs.RecordCount
> If Not rs.BOF And Not rs.EOF Then
> With CreateTableFromRst( _
> objWord.ActiveDocument.Bookmarks("ItemDetails").Range, rs,
> False)
>
> 'Apply formatting
> .Range.Columns(1).Width = 29
> .Range.Columns(2).Width = 337
> .Range.Columns(3).Width = 140
>
> objWord.Selection.MoveDown
> End With
> End If
>
> ' Cleanup
> Set objWord = Nothing
>
> End With
>
> Exit_MergeWorkTicket:
> Exit Sub
>
> Err_MergeWorkTicket:
> MsgBox Err.Number & ": " & Err.Description, vbInformation, "Error"
> Resume Exit_MergeWorkTicket
>
> End Sub
>
> Function CreateTableFromRst( _
> rngAny As Word.Range, _
> rstAny As ADODB.Recordset, _
> Optional fIncludeFieldNames As Boolean = False) _
> As Word.Table
>
> Dim objTable As Word.Table
> Dim fldAny As ADODB.Field
> Dim varData As Variant
> Dim strBookmark As String
> Dim cField As Long
>
> ' Get the data from the recordset
> varData = rstAny.GetString()
>
> ' Create the table
> With rngAny
>
> ' Creating the basic table is easy,
> ' just insert the tab-delimted text
> ' add convert it to a table
> .InsertAfter varData
> Set objTable = .ConvertToTable()
>
> End With
>
> Set CreateTableFromRst = objTable
> End Function
> --
> Arvin Meyer, MCP, MVP
> Free MS-Access downloads:
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
>
> "Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message
> news:A05DD86D-E406-4EDE-8BC7-639DF0BD5055[ at ]microsoft.com...
> >I wrote the following code:
> >
> > Dim stDoc As String
> >
> > stDoc = "P5_CmtsOIM"
> > DoCmd.OutputTo acOutputServerView, stDoc, acFormatRTF, "Cmts.doc", True
> > Word.Range.Columns(1).Width = 50
> > Word.Range.Columns(2).Width = 325
> > Word.Range.Columns(3).Width = 125
> >
> > This code gives run time error (424) object required.
> > How can I relate word.range for the word document that was opened by
> > docmd.outputto?
> >
> > Thanks
> > JP
> > "Arvin Meyer [MVP]" wrote:
> >
> >> "Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message
> >> news:3EB09C54-FECD-4574-850B-4BA16510EAD8[ at ]microsoft.com...
> >> > I'm using ms access 2003 (ADP) vs SQL Server.
> >> >
> >> > I created a module using the method DoCmd.OutputTo to export a view to
> >> > Ms
> >> > Word.
> >> >
> >> > It works fine, but it needs improvement. I have two questions.
> >> >
> >> > 1. The columns width is not properly. I would like increase the column
> >> > with.
> >> > How can I do programmatically?
> >>
> >> Word.Range.Columns(1).Width = 50
> >> Word.Range.Columns(2).Width = 325
> >> Word.Range.Columns(3).Width = 125
> >>
> >> > 2. I would like create a Template with the logo and landscape format
> >> > and
> >> > then export to it. How can I do? Or if is possible, I would Like create
> >> > the
> >> > headers in a template and the export to it.
> >>
> >> http://www.datastrat.com/Code/WordMerge.txt
> >> --
> >> Arvin Meyer, MCP, MVP
> >> Free MS-Access downloads:
> >> http://www.datastrat.com
> >> http://www.mvps.org/access
> >> http://www.accessmvp.com
> >>
> >>
> >>
>
>
>
Re: DoCmd.OutputTo
Jose Perdigao 20.09.2006 10:06:02
The function CreateTableFromRst, I don't understand the variable rngAny. How
can define it?

Thanks,
JP

"Arvin Meyer [MVP]" wrote:

[Quoted Text]
> You haven't dimmed a Word object or set a reference to it. Here's some code
> that I wrote more than 3 years ago. You'll need to set a reference to Word.
> It is well commented, but you must understand ADO coding to use it. Watch
> out for line wrapping:
>
> Private Sub MergeWorkTicket()
> On Error GoTo Err_MergeWorkTicket
>
> Dim WordTemplate As String
> Dim strFullName As String
> Dim objWord As Word.Application
> Dim objDoc As Word.Document
> Dim strSQL As String
> Dim cnnConnection As ADODB.Connection
> Dim comCommand As ADODB.Command
> Dim rs As ADODB.Recordset
> Dim strConnect As String
>
> ' ADO Recordset of the parts list on the work order
> strSQL = "SELECT tblPartsList.PartQuantity As QTY,
> tblPartsList.PartDescription As DESCRIPTION, tblPartsList.PartSerialNumber
> As SERIAL# "
> strSQL = strSQL & "FROM tblWorkOrder INNER JOIN tblPartsList ON
> tblWorkOrder.WorkOrderNumber = tblPartsList.WorkOrderNumber "
> strSQL = strSQL & "WHERE tblPartsList.WorkOrderNumber = " &
> Forms!frmWorkOrder!txtWorkOrderNumber
>
> strConnect = "Provider=SQLOLEDB;Data Source=Neptune;" & _
> "Initial Catalog=TheDBName;" & _
> "User ID=SA;password=Whatever"
>
> Set cnnConnection = New ADODB.Connection
>
> cnnConnection.Open strConnect
>
> Set comCommand = New ADODB.Command
>
> 'Debug.Print strSQL
>
> ' Assign the connection and set applicable properties
> comCommand.ActiveConnection = cnnConnection
> comCommand.CommandText = strSQL
> comCommand.CommandType = adCmdText
>
> ' Instantiate the recordset
> Set rs = New ADODB.Recordset
>
> ' Open the recordset using the command object
> rs.Open comCommand 'rs.Open comCommand, , adOpenKeyset, adLockOptimistic
>
> Set objWord = CreateObject("Word.Application")
>
>
> WordTemplate = Application.CurrentProject.Path & "\WorkTicket.dot"
>
> With objWord
> .Visible = True
> .Documents.Add (WordTemplate)
> .Caption = "Work Ticket For " & Me.cboAccountID.Column(1) & ""
>
> ' If document is protected, Unprotect it.
> If .ActiveDocument.ProtectionType <> wdNoProtection Then
> .ActiveDocument.Unprotect Password:=""
> End If
>
> .ActiveDocument.Bookmarks("Customer").Select
> .Selection.Text = (CStr(Me.cboAccountID.Column(1)))
> .ActiveDocument.Bookmarks("Address").Select
> .Selection.Text = (CStr(Me.cboAccountID.Column(2)))
> .ActiveDocument.Bookmarks("City").Select
> .Selection.Text = (CStr(Me.cboAccountID.Column(3)))
> .ActiveDocument.Bookmarks("State").Select
> .Selection.Text = (CStr(Me.cboAccountID.Column(4)))
> .ActiveDocument.Bookmarks("Zip").Select
> .Selection.Text = (CStr(Me.cboAccountID.Column(5)))
> .ActiveDocument.Bookmarks("Phone").Select
> .Selection.Text = (CStr(Me.cboAccountID.Column(8)))
> .ActiveDocument.Bookmarks("DateScheduled").Select
> .Selection.Text = (Format$(Me.txtDateScheduled, "m/d/yy")) & " " &
> (Format$(Me.txtScheduledStartTime, "h:nn AM/PM"))
> .ActiveDocument.Bookmarks("ContactName").Select
> .Selection.Text = (CStr(txtWorkOrderContact & vbNullString))
> .ActiveDocument.Bookmarks("Fax").Select
> .Selection.Text = (CStr(Me.cboAccountID.Column(9)))
> .ActiveDocument.Bookmarks("WorkOrder").Select
> .Selection.Text = (CStr(Me.txtInvoiceNumber))
> .ActiveDocument.Bookmarks("Problem").Select
> .Selection.Text = (CStr(Me.txtProblemOrService & vbNullString))
> .ActiveDocument.Bookmarks("Tech").Select
> .Selection.Text = (CStr(Me.cboScheduledTech.Column(1) &
> vbNullString))
>
> ' Debug.Print rs.RecordCount
> If Not rs.BOF And Not rs.EOF Then
> With CreateTableFromRst( _
> objWord.ActiveDocument.Bookmarks("ItemDetails").Range, rs,
> False)
>
> 'Apply formatting
> .Range.Columns(1).Width = 29
> .Range.Columns(2).Width = 337
> .Range.Columns(3).Width = 140
>
> objWord.Selection.MoveDown
> End With
> End If
>
> ' Cleanup
> Set objWord = Nothing
>
> End With
>
> Exit_MergeWorkTicket:
> Exit Sub
>
> Err_MergeWorkTicket:
> MsgBox Err.Number & ": " & Err.Description, vbInformation, "Error"
> Resume Exit_MergeWorkTicket
>
> End Sub
>
> Function CreateTableFromRst( _
> rngAny As Word.Range, _
> rstAny As ADODB.Recordset, _
> Optional fIncludeFieldNames As Boolean = False) _
> As Word.Table
>
> Dim objTable As Word.Table
> Dim fldAny As ADODB.Field
> Dim varData As Variant
> Dim strBookmark As String
> Dim cField As Long
>
> ' Get the data from the recordset
> varData = rstAny.GetString()
>
> ' Create the table
> With rngAny
>
> ' Creating the basic table is easy,
> ' just insert the tab-delimted text
> ' add convert it to a table
> .InsertAfter varData
> Set objTable = .ConvertToTable()
>
> End With
>
> Set CreateTableFromRst = objTable
> End Function
> --
> Arvin Meyer, MCP, MVP
> Free MS-Access downloads:
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
>
> "Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message
> news:A05DD86D-E406-4EDE-8BC7-639DF0BD5055[ at ]microsoft.com...
> >I wrote the following code:
> >
> > Dim stDoc As String
> >
> > stDoc = "P5_CmtsOIM"
> > DoCmd.OutputTo acOutputServerView, stDoc, acFormatRTF, "Cmts.doc", True
> > Word.Range.Columns(1).Width = 50
> > Word.Range.Columns(2).Width = 325
> > Word.Range.Columns(3).Width = 125
> >
> > This code gives run time error (424) object required.
> > How can I relate word.range for the word document that was opened by
> > docmd.outputto?
> >
> > Thanks
> > JP
> > "Arvin Meyer [MVP]" wrote:
> >
> >> "Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message
> >> news:3EB09C54-FECD-4574-850B-4BA16510EAD8[ at ]microsoft.com...
> >> > I'm using ms access 2003 (ADP) vs SQL Server.
> >> >
> >> > I created a module using the method DoCmd.OutputTo to export a view to
> >> > Ms
> >> > Word.
> >> >
> >> > It works fine, but it needs improvement. I have two questions.
> >> >
> >> > 1. The columns width is not properly. I would like increase the column
> >> > with.
> >> > How can I do programmatically?
> >>
> >> Word.Range.Columns(1).Width = 50
> >> Word.Range.Columns(2).Width = 325
> >> Word.Range.Columns(3).Width = 125
> >>
> >> > 2. I would like create a Template with the logo and landscape format
> >> > and
> >> > then export to it. How can I do? Or if is possible, I would Like create
> >> > the
> >> > headers in a template and the export to it.
> >>
> >> http://www.datastrat.com/Code/WordMerge.txt
> >> --
> >> Arvin Meyer, MCP, MVP
> >> Free MS-Access downloads:
> >> http://www.datastrat.com
> >> http://www.mvps.org/access
> >> http://www.accessmvp.com
> >>
> >>
> >>
>
>
>
Re: DoCmd.OutputTo
"Arvin Meyer [MVP]" <a[ at ]m.com> 27.09.2006 01:12:02
rngAny is a range in the Word table. It is Dim'd that way.
--
Arvin Meyer, MCP, MVP
Free MS-Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message
news:513A8CF8-EB38-4909-A739-10FE249FFE68[ at ]microsoft.com...
[Quoted Text]
> The function CreateTableFromRst, I don't understand the variable rngAny.
> How
> can define it?
>
> Thanks,
> JP
>
> "Arvin Meyer [MVP]" wrote:
>
>> You haven't dimmed a Word object or set a reference to it. Here's some
>> code
>> that I wrote more than 3 years ago. You'll need to set a reference to
>> Word.
>> It is well commented, but you must understand ADO coding to use it. Watch
>> out for line wrapping:
>>
>> Private Sub MergeWorkTicket()
>> On Error GoTo Err_MergeWorkTicket
>>
>> Dim WordTemplate As String
>> Dim strFullName As String
>> Dim objWord As Word.Application
>> Dim objDoc As Word.Document
>> Dim strSQL As String
>> Dim cnnConnection As ADODB.Connection
>> Dim comCommand As ADODB.Command
>> Dim rs As ADODB.Recordset
>> Dim strConnect As String
>>
>> ' ADO Recordset of the parts list on the work order
>> strSQL = "SELECT tblPartsList.PartQuantity As QTY,
>> tblPartsList.PartDescription As DESCRIPTION,
>> tblPartsList.PartSerialNumber
>> As SERIAL# "
>> strSQL = strSQL & "FROM tblWorkOrder INNER JOIN tblPartsList ON
>> tblWorkOrder.WorkOrderNumber = tblPartsList.WorkOrderNumber "
>> strSQL = strSQL & "WHERE tblPartsList.WorkOrderNumber = " &
>> Forms!frmWorkOrder!txtWorkOrderNumber
>>
>> strConnect = "Provider=SQLOLEDB;Data Source=Neptune;" & _
>> "Initial Catalog=TheDBName;" & _
>> "User ID=SA;password=Whatever"
>>
>> Set cnnConnection = New ADODB.Connection
>>
>> cnnConnection.Open strConnect
>>
>> Set comCommand = New ADODB.Command
>>
>> 'Debug.Print strSQL
>>
>> ' Assign the connection and set applicable properties
>> comCommand.ActiveConnection = cnnConnection
>> comCommand.CommandText = strSQL
>> comCommand.CommandType = adCmdText
>>
>> ' Instantiate the recordset
>> Set rs = New ADODB.Recordset
>>
>> ' Open the recordset using the command object
>> rs.Open comCommand 'rs.Open comCommand, , adOpenKeyset, adLockOptimistic
>>
>> Set objWord = CreateObject("Word.Application")
>>
>>
>> WordTemplate = Application.CurrentProject.Path & "\WorkTicket.dot"
>>
>> With objWord
>> .Visible = True
>> .Documents.Add (WordTemplate)
>> .Caption = "Work Ticket For " & Me.cboAccountID.Column(1) & ""
>>
>> ' If document is protected, Unprotect it.
>> If .ActiveDocument.ProtectionType <> wdNoProtection Then
>> .ActiveDocument.Unprotect Password:=""
>> End If
>>
>> .ActiveDocument.Bookmarks("Customer").Select
>> .Selection.Text = (CStr(Me.cboAccountID.Column(1)))
>> .ActiveDocument.Bookmarks("Address").Select
>> .Selection.Text = (CStr(Me.cboAccountID.Column(2)))
>> .ActiveDocument.Bookmarks("City").Select
>> .Selection.Text = (CStr(Me.cboAccountID.Column(3)))
>> .ActiveDocument.Bookmarks("State").Select
>> .Selection.Text = (CStr(Me.cboAccountID.Column(4)))
>> .ActiveDocument.Bookmarks("Zip").Select
>> .Selection.Text = (CStr(Me.cboAccountID.Column(5)))
>> .ActiveDocument.Bookmarks("Phone").Select
>> .Selection.Text = (CStr(Me.cboAccountID.Column(8)))
>> .ActiveDocument.Bookmarks("DateScheduled").Select
>> .Selection.Text = (Format$(Me.txtDateScheduled, "m/d/yy")) & " "
>> &
>> (Format$(Me.txtScheduledStartTime, "h:nn AM/PM"))
>> .ActiveDocument.Bookmarks("ContactName").Select
>> .Selection.Text = (CStr(txtWorkOrderContact & vbNullString))
>> .ActiveDocument.Bookmarks("Fax").Select
>> .Selection.Text = (CStr(Me.cboAccountID.Column(9)))
>> .ActiveDocument.Bookmarks("WorkOrder").Select
>> .Selection.Text = (CStr(Me.txtInvoiceNumber))
>> .ActiveDocument.Bookmarks("Problem").Select
>> .Selection.Text = (CStr(Me.txtProblemOrService & vbNullString))
>> .ActiveDocument.Bookmarks("Tech").Select
>> .Selection.Text = (CStr(Me.cboScheduledTech.Column(1) &
>> vbNullString))
>>
>> ' Debug.Print rs.RecordCount
>> If Not rs.BOF And Not rs.EOF Then
>> With CreateTableFromRst( _
>> objWord.ActiveDocument.Bookmarks("ItemDetails").Range, rs,
>> False)
>>
>> 'Apply formatting
>> .Range.Columns(1).Width = 29
>> .Range.Columns(2).Width = 337
>> .Range.Columns(3).Width = 140
>>
>> objWord.Selection.MoveDown
>> End With
>> End If
>>
>> ' Cleanup
>> Set objWord = Nothing
>>
>> End With
>>
>> Exit_MergeWorkTicket:
>> Exit Sub
>>
>> Err_MergeWorkTicket:
>> MsgBox Err.Number & ": " & Err.Description, vbInformation, "Error"
>> Resume Exit_MergeWorkTicket
>>
>> End Sub
>>
>> Function CreateTableFromRst( _
>> rngAny As Word.Range, _
>> rstAny As ADODB.Recordset, _
>> Optional fIncludeFieldNames As Boolean = False) _
>> As Word.Table
>>
>> Dim objTable As Word.Table
>> Dim fldAny As ADODB.Field
>> Dim varData As Variant
>> Dim strBookmark As String
>> Dim cField As Long
>>
>> ' Get the data from the recordset
>> varData = rstAny.GetString()
>>
>> ' Create the table
>> With rngAny
>>
>> ' Creating the basic table is easy,
>> ' just insert the tab-delimted text
>> ' add convert it to a table
>> .InsertAfter varData
>> Set objTable = .ConvertToTable()
>>
>> End With
>>
>> Set CreateTableFromRst = objTable
>> End Function
>> --
>> Arvin Meyer, MCP, MVP
>> Free MS-Access downloads:
>> http://www.datastrat.com
>> http://www.mvps.org/access
>> http://www.accessmvp.com
>>
>> "Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message
>> news:A05DD86D-E406-4EDE-8BC7-639DF0BD5055[ at ]microsoft.com...
>> >I wrote the following code:
>> >
>> > Dim stDoc As String
>> >
>> > stDoc = "P5_CmtsOIM"
>> > DoCmd.OutputTo acOutputServerView, stDoc, acFormatRTF, "Cmts.doc", True
>> > Word.Range.Columns(1).Width = 50
>> > Word.Range.Columns(2).Width = 325
>> > Word.Range.Columns(3).Width = 125
>> >
>> > This code gives run time error (424) object required.
>> > How can I relate word.range for the word document that was opened by
>> > docmd.outputto?
>> >
>> > Thanks
>> > JP
>> > "Arvin Meyer [MVP]" wrote:
>> >
>> >> "Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in
>> >> message
>> >> news:3EB09C54-FECD-4574-850B-4BA16510EAD8[ at ]microsoft.com...
>> >> > I'm using ms access 2003 (ADP) vs SQL Server.
>> >> >
>> >> > I created a module using the method DoCmd.OutputTo to export a view
>> >> > to
>> >> > Ms
>> >> > Word.
>> >> >
>> >> > It works fine, but it needs improvement. I have two questions.
>> >> >
>> >> > 1. The columns width is not properly. I would like increase the
>> >> > column
>> >> > with.
>> >> > How can I do programmatically?
>> >>
>> >> Word.Range.Columns(1).Width = 50
>> >> Word.Range.Columns(2).Width = 325
>> >> Word.Range.Columns(3).Width = 125
>> >>
>> >> > 2. I would like create a Template with the logo and landscape format
>> >> > and
>> >> > then export to it. How can I do? Or if is possible, I would Like
>> >> > create
>> >> > the
>> >> > headers in a template and the export to it.
>> >>
>> >> http://www.datastrat.com/Code/WordMerge.txt
>> >> --
>> >> Arvin Meyer, MCP, MVP
>> >> Free MS-Access downloads:
>> >> http://www.datastrat.com
>> >> http://www.mvps.org/access
>> >> http://www.accessmvp.com
>> >>
>> >>
>> >>
>>
>>
>>


Re: DoCmd.OutputTo
"Arvin Meyer [MVP]" <a[ at ]m.com> 27.09.2006 01:13:42
Yes, the code is running on a form. Me.cboAccountID is the name of a
combobox, bound to the AccountID field on the form.
--
Arvin Meyer, MCP, MVP
Free MS-Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message
news:24400FEA-1CED-4BC6-A68E-368F21FAE30D[ at ]microsoft.com...
[Quoted Text]
> Good morning Arvin,
>
> I set reference to Word; I understand ADO, DAO, VBA and automation
> basically
> for excel.
>
> I read your code and I tried to apply for my database and doesn't work.
>
> When I run comes the following message: method or data not found. I think
> it
> refers any control (Me.cboAccountID). Where is this control? This is a
> column
> name in the word? When we refer ME, it means is a control in a form and
> the
> procedure should be in the form. I don't understand this. Could you
> explain?
>
> I think, the first step is creating a template.dot with a table with
> columns
> number same recordset fields number, is it right?
> Then, create book marks in the word, we must give the same names of the
> fields in the recordset, is right?
>
> I'm confused about this procedure.
>
> I'll appreciate a lot for your help.
>
> Thanks a lot
>
>
>
>
> "Arvin Meyer [MVP]" wrote:
>
>> You haven't dimmed a Word object or set a reference to it. Here's some
>> code
>> that I wrote more than 3 years ago. You'll need to set a reference to
>> Word.
>> It is well commented, but you must understand ADO coding to use it. Watch
>> out for line wrapping:
>>
>> Private Sub MergeWorkTicket()
>> On Error GoTo Err_MergeWorkTicket
>>
>> Dim WordTemplate As String
>> Dim strFullName As String
>> Dim objWord As Word.Application
>> Dim objDoc As Word.Document
>> Dim strSQL As String
>> Dim cnnConnection As ADODB.Connection
>> Dim comCommand As ADODB.Command
>> Dim rs As ADODB.Recordset
>> Dim strConnect As String
>>
>> ' ADO Recordset of the parts list on the work order
>> strSQL = "SELECT tblPartsList.PartQuantity As QTY,
>> tblPartsList.PartDescription As DESCRIPTION,
>> tblPartsList.PartSerialNumber
>> As SERIAL# "
>> strSQL = strSQL & "FROM tblWorkOrder INNER JOIN tblPartsList ON
>> tblWorkOrder.WorkOrderNumber = tblPartsList.WorkOrderNumber "
>> strSQL = strSQL & "WHERE tblPartsList.WorkOrderNumber = " &
>> Forms!frmWorkOrder!txtWorkOrderNumber
>>
>> strConnect = "Provider=SQLOLEDB;Data Source=Neptune;" & _
>> "Initial Catalog=TheDBName;" & _
>> "User ID=SA;password=Whatever"
>>
>> Set cnnConnection = New ADODB.Connection
>>
>> cnnConnection.Open strConnect
>>
>> Set comCommand = New ADODB.Command
>>
>> 'Debug.Print strSQL
>>
>> ' Assign the connection and set applicable properties
>> comCommand.ActiveConnection = cnnConnection
>> comCommand.CommandText = strSQL
>> comCommand.CommandType = adCmdText
>>
>> ' Instantiate the recordset
>> Set rs = New ADODB.Recordset
>>
>> ' Open the recordset using the command object
>> rs.Open comCommand 'rs.Open comCommand, , adOpenKeyset, adLockOptimistic
>>
>> Set objWord = CreateObject("Word.Application")
>>
>>
>> WordTemplate = Application.CurrentProject.Path & "\WorkTicket.dot"
>>
>> With objWord
>> .Visible = True
>> .Documents.Add (WordTemplate)
>> .Caption = "Work Ticket For " & Me.cboAccountID.Column(1) & ""
>>
>> ' If document is protected, Unprotect it.
>> If .ActiveDocument.ProtectionType <> wdNoProtection Then
>> .ActiveDocument.Unprotect Password:=""
>> End If
>>
>> .ActiveDocument.Bookmarks("Customer").Select
>> .Selection.Text = (CStr(Me.cboAccountID.Column(1)))
>> .ActiveDocument.Bookmarks("Address").Select
>> .Selection.Text = (CStr(Me.cboAccountID.Column(2)))
>> .ActiveDocument.Bookmarks("City").Select
>> .Selection.Text = (CStr(Me.cboAccountID.Column(3)))
>> .ActiveDocument.Bookmarks("State").Select
>> .Selection.Text = (CStr(Me.cboAccountID.Column(4)))
>> .ActiveDocument.Bookmarks("Zip").Select
>> .Selection.Text = (CStr(Me.cboAccountID.Column(5)))
>> .ActiveDocument.Bookmarks("Phone").Select
>> .Selection.Text = (CStr(Me.cboAccountID.Column(8)))
>> .ActiveDocument.Bookmarks("DateScheduled").Select
>> .Selection.Text = (Format$(Me.txtDateScheduled, "m/d/yy")) & " "
>> &
>> (Format$(Me.txtScheduledStartTime, "h:nn AM/PM"))
>> .ActiveDocument.Bookmarks("ContactName").Select
>> .Selection.Text = (CStr(txtWorkOrderContact & vbNullString))
>> .ActiveDocument.Bookmarks("Fax").Select
>> .Selection.Text = (CStr(Me.cboAccountID.Column(9)))
>> .ActiveDocument.Bookmarks("WorkOrder").Select
>> .Selection.Text = (CStr(Me.txtInvoiceNumber))
>> .ActiveDocument.Bookmarks("Problem").Select
>> .Selection.Text = (CStr(Me.txtProblemOrService & vbNullString))
>> .ActiveDocument.Bookmarks("Tech").Select
>> .Selection.Text = (CStr(Me.cboScheduledTech.Column(1) &
>> vbNullString))
>>
>> ' Debug.Print rs.RecordCount
>> If Not rs.BOF And Not rs.EOF Then
>> With CreateTableFromRst( _
>> objWord.ActiveDocument.Bookmarks("ItemDetails").Range, rs,
>> False)
>>
>> 'Apply formatting
>> .Range.Columns(1).Width = 29
>> .Range.Columns(2).Width = 337
>> .Range.Columns(3).Width = 140
>>
>> objWord.Selection.MoveDown
>> End With
>> End If
>>
>> ' Cleanup
>> Set objWord = Nothing
>>
>> End With
>>
>> Exit_MergeWorkTicket:
>> Exit Sub
>>
>> Err_MergeWorkTicket:
>> MsgBox Err.Number & ": " & Err.Description, vbInformation, "Error"
>> Resume Exit_MergeWorkTicket
>>
>> End Sub
>>
>> Function CreateTableFromRst( _
>> rngAny As Word.Range, _
>> rstAny As ADODB.Recordset, _
>> Optional fIncludeFieldNames As Boolean = False) _
>> As Word.Table
>>
>> Dim objTable As Word.Table
>> Dim fldAny As ADODB.Field
>> Dim varData As Variant
>> Dim strBookmark As String
>> Dim cField As Long
>>
>> ' Get the data from the recordset
>> varData = rstAny.GetString()
>>
>> ' Create the table
>> With rngAny
>>
>> ' Creating the basic table is easy,
>> ' just insert the tab-delimted text
>> ' add convert it to a table
>> .InsertAfter varData
>> Set objTable = .ConvertToTable()
>>
>> End With
>>
>> Set CreateTableFromRst = objTable
>> End Function
>> --
>> Arvin Meyer, MCP, MVP
>> Free MS-Access downloads:
>> http://www.datastrat.com
>> http://www.mvps.org/access
>> http://www.accessmvp.com
>>
>> "Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in message
>> news:A05DD86D-E406-4EDE-8BC7-639DF0BD5055[ at ]microsoft.com...
>> >I wrote the following code:
>> >
>> > Dim stDoc As String
>> >
>> > stDoc = "P5_CmtsOIM"
>> > DoCmd.OutputTo acOutputServerView, stDoc, acFormatRTF, "Cmts.doc", True
>> > Word.Range.Columns(1).Width = 50
>> > Word.Range.Columns(2).Width = 325
>> > Word.Range.Columns(3).Width = 125
>> >
>> > This code gives run time error (424) object required.
>> > How can I relate word.range for the word document that was opened by
>> > docmd.outputto?
>> >
>> > Thanks
>> > JP
>> > "Arvin Meyer [MVP]" wrote:
>> >
>> >> "Jose Perdigao" <JosePerdigao[ at ]discussions.microsoft.com> wrote in
>> >> message
>> >> news:3EB09C54-FECD-4574-850B-4BA16510EAD8[ at ]microsoft.com...
>> >> > I'm using ms access 2003 (ADP) vs SQL Server.
>> >> >
>> >> > I created a module using the method DoCmd.OutputTo to export a view
>> >> > to
>> >> > Ms
>> >> > Word.
>> >> >
>> >> > It works fine, but it needs improvement. I have two questions.
>> >> >
>> >> > 1. The columns width is not properly. I would like increase the
>> >> > column
>> >> > with.
>> >> > How can I do programmatically?
>> >>
>> >> Word.Range.Columns(1).Width = 50
>> >> Word.Range.Columns(2).Width = 325
>> >> Word.Range.Columns(3).Width = 125
>> >>
>> >> > 2. I would like create a Template with the logo and landscape format
>> >> > and
>> >> > then export to it. How can I do? Or if is possible, I would Like
>> >> > create
>> >> > the
>> >> > headers in a template and the export to it.
>> >>
>> >> http://www.datastrat.com/Code/WordMerge.txt
>> >> --
>> >> Arvin Meyer, MCP, MVP
>> >> Free MS-Access downloads:
>> >> http://www.datastrat.com
>> >> http://www.mvps.org/access
>> >> http://www.accessmvp.com
>> >>
>> >>
>> >>
>>
>>
>>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net