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 / April 2005

Tip: Looking for answers? Try searching our database.

tabular order

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave - 15 Apr 2005 05:17 GMT
I'm populating a table using predefinded autotext chosen by selecting
checkboxes on several forms, the table has a blank row with a single bookmark
that all checkboxes reference. See example below.

If chk1.Value = True Then
ActiveDocument.Bookmarks("ActionItems").Select
ActiveDocument.AttachedTemplate.AutoTextEntries("Electrical SafetyGFCIs") _
       .Insert Where:=Selection.Range
End If

I'd like the order of entries in the table to reflect the order chosen on
the forms. Currently the first option chosen shows up last, and the last
option shows up first. I don't believe there's an insert before or after with
the method I'm using above. Does anyone have any suggestions on I can
influence the order?

I hope this makes sense. Any help would be greatIy appreciated.

Thanks,

Dave
dww8450@sbcglobal.net
Jean-Guy Marcil - 15 Apr 2005 06:24 GMT
Dave was telling us:
Dave nous racontait que :

> I'm populating a table using predefinded autotext chosen by selecting
> checkboxes on several forms, the table has a blank row with a single
[quoted text clipped - 13 lines]
>
> I hope this makes sense. Any help would be greatIy appreciated.

Here is a little something I cooked up that might be of interest!
Basically, I avoid the selection object like the pest!

'_______________________________________
Sub Main()

Dim InsertRange As Range

Set InsertRange = ActiveDocument.Bookmarks("ActionItems").Range

Set InsertRange = InsertMyAutoText(InsertRange, _
   "Electrical SafetyGFCIs")
Set InsertRange = InsertMyAutoText(InsertRange, _
   "Next one")
Set InsertRange = InsertMyAutoText(InsertRange, _
   "Another one")
Set InsertRange = InsertMyAutoText(InsertRange, _
   "Last one")

End Sub
'_______________________________________

'_______________________________________
Function InsertMyAutoText(TargetRange As Range, _
   AutoTextName As String) As Range

With TargetRange
   .Text = AutoTextName
   .InsertAutoText
   .Collapse wdCollapseEnd
End With

Set InsertMyAutoText = TargetRange

End Function
'_______________________________________

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Dave - 15 Apr 2005 20:03 GMT
Great. Thanks for the tip. I'll definitely give it a shot.

> Dave was telling us:
> Dave nous racontait que :
[quoted text clipped - 53 lines]
> End Function
> '_______________________________________
 
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.