Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-03-2013, 09:55 AM
rusteinberg rusteinberg is offline Macro to display help text Windows 7 64bit Macro to display help text Office 2010 64bit
Novice
Macro to display help text
 
Join Date: Apr 2013
Posts: 1
rusteinberg is on a distinguished road
Default Macro to display help text


A co-worker shared this macro with me and I thought others might find it useful. It looks at all help text in a Word form that has text fields and spits out the text in the Status Text and Help Text into a separate document. For Section 508 (accessibility) reasons, we only use the "Legacy" text form fields where I work.
Code:
Sub ListFormFields() 
    Dim ThisDoc As Document, NewDoc As Document 
    Dim NewTable As Table 
    Dim RowNum As Long 
    Dim ffld As FormField 
     
    Application.ScreenUpdating = False 
     
    Set ThisDoc = ActiveDocument 
    Set NewDoc = Documents.Add 
     
    Set NewTable = NewDoc.Tables.Add(NewDoc.Content, ThisDoc.Content.FormFields.Count + 1, 4) 
    RowNum = 1 
     
    NewTable.Cell(RowNum, 1).Range.Text = "Field" 
    NewTable.Cell(RowNum, 2).Range.Text = "Location" 
    NewTable.Cell(RowNum, 3).Range.Text = "StatusText" 
    NewTable.Cell(RowNum, 4).Range.Text = "HelpText" 
    NewTable.Rows(1).Range.Font.Bold = True 
    NewTable.Rows(1).HeadingFormat = True 
     
    For Each ffld In ThisDoc.Content.FormFields 
        RowNum = RowNum + 1 
        NewTable.Cell(RowNum, 1).Range.Text = ffld.Name 
        NewTable.Cell(RowNum, 2).Range.Text = _ 
        "Page " & ThisDoc.Range(ffld.Range.Start, ffld.Range.Start).Information(wdActiveEndPageNumber) _ 
        & ", Line " & ffld.Range.Information(wdFirstCharacterLineNumber) 
        NewTable.Cell(RowNum, 3).Range.Text = ffld.StatusText 
        NewTable.Cell(RowNum, 4).Range.Text = ffld.HelpText 
    Next ffld 
     
    Application.ScreenUpdating = True 
     
    Set NewTable = Nothing 
    Set NewDoc = Nothing 
    Set ThisDoc = Nothing 
     
End Sub

Last edited by macropod; 04-03-2013 at 02:24 PM. Reason: Added code tags & formatting
Reply With Quote
Reply

Tags
form help macro

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to display help text Macro to find text and replace with form field containing that text iiiiifffff Word VBA 16 06-04-2016 01:47 AM
Macro to display help text If formula result is negative then display text oxicottin Excel 3 12-03-2012 02:12 AM
MS Word 2007 Won't Display Text Jess Wunman Word 1 03-06-2012 04:26 PM
Macro to display help text Need help on Macro 03- Find text - if text is blank then remove line simpleonline1234 Word VBA 1 02-25-2011 02:28 AM
Macro to display help text Outlook 2007 doesn't display plain text messages. forbeselderlaw Outlook 1 02-03-2010 02:42 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:59 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft