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

Tip: Looking for answers? Try searching our database.

Return MultiPage textbox tags?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ed - 13 Oct 2005 20:01 GMT
I have a form with a MultiPage control.  There are 11 pages, and one Textbox
on each page.  The Tag property of each Textbox has been set to correspond
to a certain Custom Document Variable.  On Form_Initialize, I would like to
loop through all the text boxes, read the tag, and retrieve the
corresponding variable value to display in the text box.

I have
  Dim mp As Multipage
  Dim str As String
  Dim tbx As TextBox

Here I can't get the right object to get the Tag property.  I tried:
  For Each tbx In Me.Controls
  For Each tbx In mp.Pages
and a few other combinations I don't recall, but when I type
  str=  tbx.   ''' I can never get the AutoText to show the Tag property
for whatever object tbx has become.

Can someone help me out, please?

Ed
Ed - 13 Oct 2005 23:58 GMT
Never mind.  I found a solution.

For Each ctl In Me.Controls
   strName = ctl.Name
   If Left(strName, 7) = "TextBox" Then
       strTag = ctl.Tag
     On Error Resume Next
       strVar = doc.Variables(strTag).Value
     On Error GoTo 0
       Me.Controls(strName).Text = strVar
   End If
Next ctl

> I have a form with a MultiPage control.  There are 11 pages, and one Textbox
> on each page.  The Tag property of each Textbox has been set to correspond
[quoted text clipped - 17 lines]
>
> Ed

Rate this thread:






 
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.