Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2004

Tip: Looking for answers? Try searching our database.

Positioning objects in a word document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brett Halligan - 27 Sep 2004 23:46 GMT
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
Word Heretic - 30 Sep 2004 12:00 GMT
If you use Selection you can Collapse at the end.

Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)

Brett Halligan reckoned:

>Hello there
>
[quoted text clipped - 44 lines]
>
>Brett Halligan
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.