|
-
Dec 2nd, 2004, 12:33 PM
#1
Thread Starter
Addicted Member
MS Word (Solved)
I am trying to figure out how to get ms word using the VB editor to tab through my textboxes. Word dose not give you the option to use the normal tab index property. Becouse, that is not a setting to change. can someone help me?
Last edited by jmhfloor; Dec 3rd, 2004 at 04:41 PM.
-
Dec 2nd, 2004, 12:40 PM
#2
Welcome to the Forums.
Are the textboxes on a userform or actually just on the document?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 2nd, 2004, 04:29 PM
#3
Thread Starter
Addicted Member
If we are talking about the same thing they are actually on the Document.
I dont really know what you mean by user form.
I opened a word document I went to Macro and went to VB editor
from there I went to design view and created my document. Then went back to VB Editor to put in my code for what I need it to do.
So with all that said I think it is on the document.
I would attach one but it wont let me uplost .word files
Last edited by jmhfloor; Dec 2nd, 2004 at 04:45 PM.
-
Dec 2nd, 2004, 05:28 PM
#4
It will if you zip it first.
Yes, its on the document itself. If it was a userform it would look
like a VB Form.
Forums going down in a couple of minutes.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 3rd, 2004, 09:05 AM
#5
Thread Starter
Addicted Member
Re: MS Word tabing threw document
ok so it is on the document. What do I do now? My Office Comp. dose not have a program to zip so I am going to try to DL one in the next few min.
so it seems Guru that you know what I am talking about. Do you need the document to be able to help me or can you just post the code that I need?
-
Dec 3rd, 2004, 09:08 AM
#6
Thread Starter
Addicted Member
Re: MS Word tabing threw document
hrm let me try something with this new version here. I got it I got it!!!! ok Now you have my file. I hope you can help me figure it out.
Last edited by jmhfloor; Dec 3rd, 2004 at 04:30 PM.
-
Dec 3rd, 2004, 02:19 PM
#7
Re: MS Word tabing threw document
Ok, solved it. Seems there is no support for TabIndex or tabbing. so I made my own. When the doc is opened the textboxes are set to allow the tab character to be placed into the textbox. This will allow us to trap for the tab keydown event.
Code:
Private Sub Document_Open()
TextBox1.TabKeyBehavior = True
TextBox2.TabKeyBehavior = True
TextBox3.TabKeyBehavior = True
End Sub
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 9 And Shift = 0 Then
KeyCode = 0
TextBox2.Select
ElseIf KeyCode = 9 And Shift = 1 Then
KeyCode = 0
TextBox3.Select
End If
End Sub
Private Sub TextBox2_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 9 And Shift = 0 Then
KeyCode = 0
TextBox3.Select
ElseIf KeyCode = 9 And Shift = 1 Then
KeyCode = 0
TextBox1.Select
End If
End Sub
Private Sub TextBox3_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 9 And Shift = 0 Then
KeyCode = 0
TextBox1.Select
ElseIf KeyCode = 9 And Shift = 1 Then
KeyCode = 0
TextBox2.Select
End If
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 3rd, 2004, 02:43 PM
#8
Thread Starter
Addicted Member
Re: MS Word tabing threw document
Awsome that works Great. one last question will the same code work for the combo boxes and check boxes?
-
Dec 3rd, 2004, 02:55 PM
#9
Re: MS Word tabing threw document
Yes, but you need to add their respective events like I did for the textboxes. Also, update the order of control tabbing. The Tabbing is only supported when the textbox, for ex., is placed on a UserForm. If its on the document itself then its not supported.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 3rd, 2004, 03:31 PM
#10
Thread Starter
Addicted Member
Re: MS Word tabing threw document
ok I got the tab through to work. I only have 1 last question. How do I put information in those drop down combo boxes?
-
Dec 3rd, 2004, 03:36 PM
#11
Re: MS Word tabing threw document
I take it we are still talking on the document level. Probably in the Document_Open event you can load the cbo in there using something like...
Code:
Private Sub Document_Open()
Dim i As Integer
TextBox1.TabKeyBehavior = True
TextBox2.TabKeyBehavior = True
TextBox3.TabKeyBehavior = True
For i = 1 To 10
ComboBox1.AddItem "Test item " & i
Next
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 3rd, 2004, 03:42 PM
#12
Thread Starter
Addicted Member
Re: MS Word tabing threw document
hrm, I could not get that code to work?
Yes we are still talking about the same form. however when I lick on combobox1 there is still nothing in there and I used your code
Dim i As Integer
TextBox1.TabKeyBehavior = True
TextBox2.TabKeyBehavior = True
TextBox3.TabKeyBehavior = True
For i = 1 To 10
ComboBox1.AddItem "Test item " & i
Next
End Sub
I have all the tab threw working. it works GREAT! but now I just need these drop down boxes to have information allready in them. am I puting the code in the wrong spot? I put it with the other Textbox tab key statement?
-
Dec 3rd, 2004, 03:56 PM
#13
Thread Starter
Addicted Member
Re: MS Word Combo Box drop down inputing info
And is it possible to make it so when you tab threw the curser automaticly go to the far left side of the text box? I seems that where ever you last clicked in the box is where the tab automaticly goes and you have to either click the front or backspace to the front. Is there a way to do that. and if so that is all I need and this program will be finished!!1
PS. Guru you are truly a Guru. You have saved my Hide!
-
Dec 3rd, 2004, 04:06 PM
#14
Re: MS Word Combo Box drop down inputing info
It should be in the Document_Open event. This way when you open the
document it will be already populated, unless the contents of the cbo are
driven by some kind of input from the user.
Also make sure that the combo your using is the same control name as in
your code - "ComboBox1".
you can make the cursor be at the begining of the textbox using the code - TextBox1.SelStart = 0.
HTH
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 3rd, 2004, 04:40 PM
#15
Thread Starter
Addicted Member
Re: MS Word Combo Box drop down inputing info
I GOT IT!. Guru you are the man thanks for taking all the time to help me with this program!!!!!!!!!!!!!!!
-
Dec 3rd, 2004, 04:52 PM
#16
Re: MS Word (Solved)
No prob. Glad to help and as most members know, I am an Office Automation Addict in addition to a VB Forumns Addict! 
's on project completion.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|