![]() |
#1
|
|||
|
|||
![]()
Hi!
Sorry if this is an "amateur" question: i've used VBA in Excel fairly extensively, but not much in Word. Im using MSOffice 2010. I have a template document with (working) code in it, which asks the User for various details. These details are processed and stored in a dynamic array, until the User indicates that the "data gathering" has completed. At this point I want to write the array to the end of the document, with each element of the array being a "sentence". This bit is working. Extracts from the code are shown below Code:
Dim intMax As Integer Dim intPtr As Integer Dim strDate As String Dim strCategory As String Dim strHdr As String Dim strOldCategory As String Dim strText As String strOldCategory = "" With ActiveDocument.Content .InsertAfter vbCrLf intMax = UBound(gvarTexts) '* '** Add texts, with formatting if appropriate. '* For intPtr = 0 To intMax strCategory = Left(gvarTexts(intPtr), 20) strDate = Mid(gvarTexts(intPtr), 22, 10) strText = Mid(gvarTexts(intPtr), 33) If strCategory <> strOldCategory Then strOldCategory = strCategory strHdr = strCategory & ":" & strDate .InsertAfter vbCrLf & strHdr & vbCrLf '* '** Here something magic needs to happen to change strHdr '** which has just been written to be Bold and Underlined! '* End If .InsertAfter strText & vbCrLf Next intPtr I think it needs to happen around the area marked "Here something magic" etc. Can any kind soul point me in the right direction? |
Tags |
bold, font, underline |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
gurp99 | Word VBA | 11 | 03-12-2012 04:05 PM |
![]() |
seanspotatobusiness | PowerPoint | 2 | 01-13-2011 12:08 PM |
![]() |
stella@happisburgh.net | Excel | 3 | 12-05-2010 08:03 AM |
![]() |
cornettd | PowerPoint | 1 | 05-10-2010 10:07 AM |
Problem with Bold text in the headers | gail | Word | 0 | 04-13-2010 02:15 AM |