Userform Text Box limited to 256 characters 
Author Message
 Userform Text Box limited to 256 characters

Hi All:
I am stumped:
My template has a userform which allows the user to choose
items needed to complete the original document.  
Those "chosen" items are on the userform so the user can
check a box, and they move to the new document based on
the template. A bit of the code is as follows:
Private Sub CommandButton1_Click()
Dim acontrol As Control, controlname As String
For i = 1 To 77
controlname = "SC" & i
    For Each acontrol In UserForm1.Controls
        If acontrol.Name = controlname Then
            If acontrol.Value = True Then
            'selects the bookmark to insert paragraph
                ActiveDocument.Bookmarks("SC").Range.Select
                Selection.GoTo What:=wdGoToBookmark,
Name:="SC"
                Selection.Collapse Direction:=wdCollapseEnd
                'inserts selected paragraphs above
bookmark so the last item in the file is the bookmark sc
                Selection.MoveEnd unit:=wdCharacter,
Count:=-1

ActiveDocument.AttachedTemplate.AutoTextEntries
(acontrol.Name).Insert Where:=Selection.Range,
RichText:=True
            End If
        End If
    Next acontrol
    Next i
'Set myRange = ActiveDocument.Range
(Start:=ActiveDocument.Bookmarks("SortStart"), _
'    End:=ActiveDocument.Content.End)
'Set newDoc = Documents.Add
'newDoc.Content.InsertAfter "pear" & Chr(13) & "zucchini"
& Chr(13) _
'    & "apple" & Chr(13)
'newDoc.Content.Sort SortOrder:=wdSortOrderAscending
Dim myRange As Range
Set myRange = ActiveDocument.Bookmarks("SortStart").Range
myRange.SetRange Start:=myRange.Start, _
        End:=ActiveDocument.Content.End
    ActiveWindow.ActivePane.View.Type = wdOutlineView
    ActiveWindow.ActivePane.View.CollapseOutline
Range:=myRange
    myRange.Sort sortorder:=wdSortOrderAscending
    '    ExcludeHeader:=False, FieldNumber:="Paragraphs", _
    '    SortFieldType:=wdSortFieldAlphanumeric,
sortorder:=wdSortOrderAscending, _
    '     FieldNumber2:="",
SortFieldType2:=wdSortFieldAlphanumeric, SortOrder2:= _
     '   wdSortOrderAscending, FieldNumber3:="",
SortFieldType3:= _
     '   wdSortFieldAlphanumeric, SortOrder3:=Separator:= _
     '   wdSortSeparateByTabs, SortColumn:=False,
CaseSensitive:=False, LanguageID _
     '   :=wdLanguageNone
    ActiveWindow.ActivePane.View.ExpandOutline
Range:=myRange
    If ActiveWindow.View.SplitSpecial = wdPaneNone Then
        ActiveWindow.ActivePane.View.Type = wdPageView
    Else
        ActiveWindow.View.Type = wdPageView
    End If
'    End With
'Selection.GoTo What:=wdGoToBookmark, Name:="SC"
Unload UserForm1
UserForm1.Hide
End Sub

Private Sub SC1_MouseMove(ByVal Button As Integer, ByVal
Shift As Integer, ByVal X As Single, ByVal Y As Single)
TextBox1.Text =
ActiveDocument.AttachedTemplate.AutoTextEntries
("SC1").Value
End Sub

Private Sub SC2_MouseMove(ByVal Button As Integer, ByVal
Shift As Integer, ByVal X As Single, ByVal Y As Single)
TextBox1.Text =
ActiveDocument.AttachedTemplate.AutoTextEntries
("SC2").Value
End Sub
Private Sub SC3_MouseMove(ByVal Button As Integer, ByVal
Shift As Integer, ByVal X As Single, ByVal Y As Single)
TextBox1.Text =
ActiveDocument.AttachedTemplate.AutoTextEntries
("SC3").Value
End Sub

Private Sub SC4_MouseMove(ByVal Button As Integer, ByVal
Shift As Integer, ByVal X As Single, ByVal Y As Single)
TextBox1.Text =
ActiveDocument.AttachedTemplate.AutoTextEntries
("SC4").Value
End Sub
The Private Subroutine with the SC#'s in them number 77,
and they are based upon autotext entries in the template.  
My problem is that I cannot get the text box to show the
entire autotext entry, it stops after 256 characters. How
can I get this to happen?
Also, if the user decides they should have chosen more
than the item they did, they can go back and recoose, but
how do I get the autonumbered(outlined) format to
realphabetize just the chosen items, and not the whole
document, or not just the headers? Thanks you in advance
for your help, I know this must look a mess, it's my first
attempt and Doug Robbins did help me a great deal in
getting me started with some neat code.
Thanks again for your help, and if you have another
suggestion to make this easier, I would appreciate it!
Connie



Mon, 12 Jan 2004 01:08:07 GMT  
 Userform Text Box limited to 256 characters
Hi All:
I am stumped:
My template has a userform which allows the user to choose
items needed to complete the original document.  
Those "chosen" items are on the userform so the user can
check a box, and they move to the new document based on
the template. A bit of the code is as follows:
Private Sub CommandButton1_Click()
Dim acontrol As Control, controlname As String
For i = 1 To 77
controlname = "SC" & i
    For Each acontrol In UserForm1.Controls
        If acontrol.Name = controlname Then
            If acontrol.Value = True Then
            'selects the bookmark to insert paragraph
                ActiveDocument.Bookmarks("SC").Range.Select
                Selection.GoTo What:=wdGoToBookmark,
Name:="SC"
                Selection.Collapse Direction:=wdCollapseEnd
                'inserts selected paragraphs above
bookmark so the last item in the file is the bookmark sc
                Selection.MoveEnd unit:=wdCharacter,
Count:=-1

ActiveDocument.AttachedTemplate.AutoTextEntries
(acontrol.Name).Insert Where:=Selection.Range,
RichText:=True
            End If
        End If
    Next acontrol
    Next i
'Set myRange = ActiveDocument.Range
(Start:=ActiveDocument.Bookmarks("SortStart"), _
'    End:=ActiveDocument.Content.End)
'Set newDoc = Documents.Add
'newDoc.Content.InsertAfter "pear" & Chr(13) & "zucchini"
& Chr(13) _
'    & "apple" & Chr(13)
'newDoc.Content.Sort SortOrder:=wdSortOrderAscending
Dim myRange As Range
Set myRange = ActiveDocument.Bookmarks("SortStart").Range
myRange.SetRange Start:=myRange.Start, _
        End:=ActiveDocument.Content.End
    ActiveWindow.ActivePane.View.Type = wdOutlineView
    ActiveWindow.ActivePane.View.CollapseOutline
Range:=myRange
    myRange.Sort sortorder:=wdSortOrderAscending
    '    ExcludeHeader:=False, FieldNumber:="Paragraphs", _
    '    SortFieldType:=wdSortFieldAlphanumeric,
sortorder:=wdSortOrderAscending, _
    '     FieldNumber2:="",
SortFieldType2:=wdSortFieldAlphanumeric, SortOrder2:= _
     '   wdSortOrderAscending, FieldNumber3:="",
SortFieldType3:= _
     '   wdSortFieldAlphanumeric, SortOrder3:=Separator:= _
     '   wdSortSeparateByTabs, SortColumn:=False,
CaseSensitive:=False, LanguageID _
     '   :=wdLanguageNone
    ActiveWindow.ActivePane.View.ExpandOutline
Range:=myRange
    If ActiveWindow.View.SplitSpecial = wdPaneNone Then
        ActiveWindow.ActivePane.View.Type = wdPageView
    Else
        ActiveWindow.View.Type = wdPageView
    End If
'    End With
'Selection.GoTo What:=wdGoToBookmark, Name:="SC"
Unload UserForm1
UserForm1.Hide
End Sub

Private Sub SC1_MouseMove(ByVal Button As Integer, ByVal
Shift As Integer, ByVal X As Single, ByVal Y As Single)
TextBox1.Text =
ActiveDocument.AttachedTemplate.AutoTextEntries
("SC1").Value
End Sub

Private Sub SC2_MouseMove(ByVal Button As Integer, ByVal
Shift As Integer, ByVal X As Single, ByVal Y As Single)
TextBox1.Text =
ActiveDocument.AttachedTemplate.AutoTextEntries
("SC2").Value
End Sub
Private Sub SC3_MouseMove(ByVal Button As Integer, ByVal
Shift As Integer, ByVal X As Single, ByVal Y As Single)
TextBox1.Text =
ActiveDocument.AttachedTemplate.AutoTextEntries
("SC3").Value
End Sub

Private Sub SC4_MouseMove(ByVal Button As Integer, ByVal
Shift As Integer, ByVal X As Single, ByVal Y As Single)
TextBox1.Text =
ActiveDocument.AttachedTemplate.AutoTextEntries
("SC4").Value
End Sub
The Private Subroutine with the SC#'s in them number 77,
and they are based upon autotext entries in the template.  
My problem is that I cannot get the text box to show the
entire autotext entry, it stops after 256 characters. How
can I get this to happen?
Also, if the user decides they should have chosen more
than the item they did, they can go back and recoose, but
how do I get the autonumbered(outlined) format to
realphabetize just the chosen items, and not the whole
document, or not just the headers? Thanks you in advance
for your help, I know this must look a mess, it's my first
attempt and Doug Robbins did help me a great deal in
getting me started with some neat code.
Thanks again for your help, and if you have another
suggestion to make this easier, I would appreciate it!
Connie



Mon, 12 Jan 2004 01:08:10 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Userforms 256 character limitation cont.

2. SQL String limited to 256 characters

3. Limiting text box entry to 4 characters?

4. 256 colour text box please

5. Limiting Access to Text Boxes, List Boxes and Combo Boxes

6. workaround for 256 controls per form limit?

7. collection limited to 256 items??

8. collection limited to 256 items??

9. Problem: Populate listbox from VB-script with more than 256 characters

10. String only keeps 256 characters

11. Contenating more than 256 character?

12. Character limit of Combo Box - Drop Down Item

 

 
Powered by phpBB® Forum Software