jimrward
Well-known Member
- Joined
- Feb 24, 2003
- Messages
- 1,903
- Office Version
- 2021
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
- 2003 or older
- Platform
- Windows
does anyone have any code they have put together to convert old wordbasic dialog statements to VBA forms, the statements have been extracted to a txt file and read in line by line
I started to put together a VBA macro and all was well, TEXT, TEXTBOXES, CHECKBOXES all ok, until I came across WORDBASIC.GROUPBOX, which is now treated as a frame, it is easy to add a frame but it obscures all you have added to the form, so it needs to be added to the frame
My approach is possibly going to be one pass thru the data and create the frames, Frame1 to frameN, and store the sizes of the frames, then test the X, Y for new items and if they fit within a fram then add to the frame
My problem is if I have say 5 frames how can I address them with an index to add a control in the form of
set newtextbox = Frame(j).controls.add (("Forms.textbox.1")
With NewTextBox
If MyLab <> "" Then
.Name = MyLab
End If
.Top = Y
.Left = X
.Width = W
.Height = H
.Font.Size = 10
.Font.Name = "Tahoma"
.BorderStyle = fmBorderStyleSingle
.SpecialEffect = fmSpecialEffectFlat
End With
End If
it is not playing with the Frame(J) bit
any ideas
here is a sample of the data in case no one is familiar
WordBasic.BeginDialog 748, 433, "NOTE FOR FILE"
WordBasic.Text 29, 3, 516, 13, "Use the TAB key / Shift + TAB / Alt + letter to move between boxes"
WordBasic.Text 9, 18, 155, 13, "Name of Caller:", "Text1"
WordBasic.TextBox 169, 16, 262, 18, "TextBox1"
WordBasic.Text 480, 18, 65, 13, "File Ref:", "Text2"
WordBasic.TextBox 560, 16, 156, 18, "TextBox2"
WordBasic.Text 171, 44, 167, 13, "Date of Conversation:", "Text3"
WordBasic.TextBox 339, 41, 160, 18, "TextBox3"
WordBasic.Text 509, 44, 43, 13, "Time:", "Text4"
WordBasic.TextBox 559, 40, 160, 18, "TextBox4"
WordBasic.GroupBox 10, 65, 716, 130, "INFORMATION ON CALLER"
I started to put together a VBA macro and all was well, TEXT, TEXTBOXES, CHECKBOXES all ok, until I came across WORDBASIC.GROUPBOX, which is now treated as a frame, it is easy to add a frame but it obscures all you have added to the form, so it needs to be added to the frame
My approach is possibly going to be one pass thru the data and create the frames, Frame1 to frameN, and store the sizes of the frames, then test the X, Y for new items and if they fit within a fram then add to the frame
My problem is if I have say 5 frames how can I address them with an index to add a control in the form of
set newtextbox = Frame(j).controls.add (("Forms.textbox.1")
With NewTextBox
If MyLab <> "" Then
.Name = MyLab
End If
.Top = Y
.Left = X
.Width = W
.Height = H
.Font.Size = 10
.Font.Name = "Tahoma"
.BorderStyle = fmBorderStyleSingle
.SpecialEffect = fmSpecialEffectFlat
End With
End If
it is not playing with the Frame(J) bit
any ideas
here is a sample of the data in case no one is familiar
WordBasic.BeginDialog 748, 433, "NOTE FOR FILE"
WordBasic.Text 29, 3, 516, 13, "Use the TAB key / Shift + TAB / Alt + letter to move between boxes"
WordBasic.Text 9, 18, 155, 13, "Name of Caller:", "Text1"
WordBasic.TextBox 169, 16, 262, 18, "TextBox1"
WordBasic.Text 480, 18, 65, 13, "File Ref:", "Text2"
WordBasic.TextBox 560, 16, 156, 18, "TextBox2"
WordBasic.Text 171, 44, 167, 13, "Date of Conversation:", "Text3"
WordBasic.TextBox 339, 41, 160, 18, "TextBox3"
WordBasic.Text 509, 44, 43, 13, "Time:", "Text4"
WordBasic.TextBox 559, 40, 160, 18, "TextBox4"
WordBasic.GroupBox 10, 65, 716, 130, "INFORMATION ON CALLER"