B
Brett Halligan
Hello there
ill cut strait to the chase.
I am trying to add, sequentially, objects to a word document. but when
I add these objects, tables in this example, it adds them to the top
of the document, If I use code like
{
strTemp = "Project" & vbTab & vbTab & rsExtras.Fields("Project
Name").Value & vbCrLf
strTemp = strTemp & "Job No" & vbTab & rsExtras.Fields("Job
Number").Value & vbCrLf
strTemp = = strTemp vbTab & "Created By" & vbTab &
rsExtras.Fields("Created By").Value & vbCrLf
strTemp = = strTemp vbTab & "Date Created" & vbTab &
rsExtras.Fields("Date Created").Value & vbCrLf
wrdAplication.ActiveDocument.Content =
wrdAplication.ActiveDocument.Content & strTemp
Set rTable = wrdAplication.ActiveDocument.Range(Start:=0, End:=0)
for intHloop = 1 To intHloop + 1
Set rTable = wrdAplication.ActiveDocument.Range(Start:=0,
End:=0)
wrdAplication.Selection.GoTo What:=wdGoToLine, Which:=wdGoToLast
wrdAplication.Selection.Tables.Add rTable, (lngCalculated
/ 10) + (intDistro + 5), (4 + intDatesPPage)
wrdAplication.Selection.GoTo What:=wdGoToLine,
Which:=wdGoToLast
next intHloop
}
The above code is only so I can get a feel for document object model,
I basically am trying to add a new table at the curser position, the
selection.goto method then moves the curser to the bottom of the page,
but when it inserts the next table it inserts the code at the top of
the page.
I am sure this is something really simple and I have just missed it in
my "hacked" together code.
Any help anyone could give would be great!
Thanks in advance and always, Kind regards
Brett Halligan
ill cut strait to the chase.
I am trying to add, sequentially, objects to a word document. but when
I add these objects, tables in this example, it adds them to the top
of the document, If I use code like
{
strTemp = "Project" & vbTab & vbTab & rsExtras.Fields("Project
Name").Value & vbCrLf
strTemp = strTemp & "Job No" & vbTab & rsExtras.Fields("Job
Number").Value & vbCrLf
strTemp = = strTemp vbTab & "Created By" & vbTab &
rsExtras.Fields("Created By").Value & vbCrLf
strTemp = = strTemp vbTab & "Date Created" & vbTab &
rsExtras.Fields("Date Created").Value & vbCrLf
wrdAplication.ActiveDocument.Content =
wrdAplication.ActiveDocument.Content & strTemp
Set rTable = wrdAplication.ActiveDocument.Range(Start:=0, End:=0)
for intHloop = 1 To intHloop + 1
Set rTable = wrdAplication.ActiveDocument.Range(Start:=0,
End:=0)
wrdAplication.Selection.GoTo What:=wdGoToLine, Which:=wdGoToLast
wrdAplication.Selection.Tables.Add rTable, (lngCalculated
/ 10) + (intDistro + 5), (4 + intDatesPPage)
wrdAplication.Selection.GoTo What:=wdGoToLine,
Which:=wdGoToLast
next intHloop
}
The above code is only so I can get a feel for document object model,
I basically am trying to add a new table at the curser position, the
selection.goto method then moves the curser to the bottom of the page,
but when it inserts the next table it inserts the code at the top of
the page.
I am sure this is something really simple and I have just missed it in
my "hacked" together code.
Any help anyone could give would be great!
Thanks in advance and always, Kind regards
Brett Halligan