Many thanks. You have struggled a lot to learn Word VBA. There are no good books to learn Word VBA. Microsoft In its wisdom has not provided detailed help on word VBA. I have been searching Google to learn Word VBA codes for a long time. Your video was helpful in clearing my doubts.
Very interesting tutorials. Would it be possible to split a document by a style (heading…) and save each part with all styles with the name of the heading ?
is there any changes require for VBA code for diff versions of MS Word? Also let me if we can connect on any code forum ?? We have application which opens template in diff MS word and office 365 but when we installed MS office 2016 or 2019 ver. It create issue. need someone's help ? I am not VBA programmer but its part of my project.
I am working with content controls and need the font in my drop-down menus to be grey before being selected, and then turn black when something is selected. Can I program that through VBA? (total beginner here)
Not so default. I had to search for it in templates. It did not come up in the first several pages of templates. Probably a MS hic up as they always do. As good as I am programming in VBA for Excel and Access I never ventured into these statements. It is nice to see another side to VBA.
@@SigmaCoding when i type a text under one heading part of it same should be typed under different heading as well which normally falls on different page. Which i mannualy copy and paste to another heading.
@@ramanjha5474 Gotcha, so that's a little complex, especially if it's not in the header and footer. If you know the number of ranges you want to edit beforehand, what you could do is add an event to document that would change all the ranges so that they all match. The problem is you would only want this event to be triggered if one of the ranges that are "linked" to the other ranges is modified. Also, it would probably make sense that this is only executed once you have finished modifying the range. In other words, don't keep updating it as I'm typing only update the ranges after I'm finished editing.
I'm not very knowledgeable in programming but I'm trying to learn. So I've got a Word Document which is some sort of template. I made a little VBA GUI with Radio Buttons and Checkboxes. Based on the value selected, I would like to click on a button to replace bookmarked value or search for keywords within that word document template and replace these value with constant variable based on the selection choice. ie: First Name: (Textbox) Last Name: (Textbox) Diplomas: (Checkbox with choices; High School, College, University (University unlock more choices; Bachelor, Master, Doctorat) Date of Graduation: (Textbox under date format) Values are imported based on Word VBA GUI. GUI had a Document_Open() function to Load my GUI form so when I open the doc, I get the GUI on top. I make my selection and I am trying to fill chosen field in the document based on what the GUI captured... I'm really tumbling right now and making very slow progress but I was wondering if you could give me a hand on that.
If I am understanding this correctly, you have a GUI that was built using VBA. That GUI has different components that display different pieces of information or allow a user to enter/choose different pieces of information. The user fills out your GUI, and you have a button that will "export" the values in the GUI to different parts of a Word Document template that you created. However, you're struggling with the actual "exporting" of values from the GUI to the Document, correct? If that is the case, I need to see the actual code that you're using so I can see how everything is "talking to each other". If you don't mind could you please send all the code you currently have, along with a copy of the template so I can see how it's laid out to my email coding.sigma@gmail.com?
4 роки тому
Ca you show me how to copy text using VBA on word? Like a button to copy a text rather than I select, copy and paste?
You showed how you can show the statistics of a document like how many characters are there in the document. But how can this function be used on the 'front' side of the document? So how can the user of the document use this? That's not clearing to me
Hi, I have 1000 pages in word document In that 1st page has two highlighted word in two different places And I want to highlight rest 999 page at exact the same location ... Can you please share the VBA code for that
Excellent video, helped me a lot. Can you please help me storing some strings in word document file using vba ? string will not be shown unless I run some code again to retrieve that string
@@SigmaCoding Thanks for replying, my problem has been solved by viewing Microsoft docs. The currently problem I am facing is that I want to develop a website on which a user will upload a word document in "docx" format and will apply some operations (vba in the background) on the file and will download the file with the vba code applied. For such purpose, how can I use VBA in visual studio or any other web development IDE ?
How to code a command button to output question with selected radio button option on a SEPARATE document? Ex. How are you? (X) Good ( ) Bad -------> click Submit (command button ------> How are you? Good [separate document]
@@SigmaCoding No, just open new separate document with the question and selected answer. Here's a link to the document I'm trying to create the command button for: pixeldrain.com/u/XYstXbgl So only the selected answers & filled textboxes would go on a separate document with their respective questions and titles and all (ex. ACO blah blah). It's basically a new document with the exact same as this document, but only with the answers.
I need a Word Macro to convert selection text from this: This is a =selection in a word =document. To this: This is a s________ in a word d_______. Can anyone help me out? I've tried Sub conv_1() Dim Sentence As String Dim i As Integer Sentence = Selection.Text For i = 1 To Len(Sentence) If Mid(Sentence, i, 1) Like "[a-zA-Z]" Then Mid(Sentence, i, 1) = "_" End If Next i Selection.Text = Sentence End Sub but it converts all the selected words to Dash-Dash-Dash. I've also tried Sub conv_2()
'Declare variables Dim intCount As Integer Dim intLength As Integer Dim strInput As String Dim strOutput As String Dim strTemp As String
'Get the selected text strInput = Selection
'If nothing is selected, exit If strInput = "" Then Exit Sub End If
'Split the string into an array Dim arrWords arrWords = Split(strInput)
'Loop through each word in the array For intCount = LBound(arrWords) To UBound(arrWords)
'Get the length of the word intLength = Len(arrWords(intCount))
'If the word is longer than 1 character, convert the word If intLength > 1 Then strTemp = arrWords(intCount) strOutput = strOutput & Left(strTemp, 1) & String(intLength - 2, "_") & _ Right(strTemp, 1) & " " Else 'If the word is 1 character, add it to the output string strOutput = strOutput & arrWords(intCount) & " " End If
Next
'Trim the trailing space strOutput = Trim(strOutput)
'Replace the original selection with the converted text Selection.TypeText Text:=strOutput
End Sub but it converts all words into A-Dash-A. I don't know how to make it so that only the words that have an equal sign next to them get turned into A-Dash-Dash. I would appreciate any help on this!
Thanks for sharing this information! There are lots of vba videos out there but not so much for Word.
That was one of the reasons I started this whole Word VBA series was because of that specific reason. It's so hard to find content on it.
Many thanks. You have struggled a lot to learn Word VBA. There are no good books to
learn Word VBA. Microsoft In its wisdom has not provided detailed help on word VBA.
I have been searching Google to learn Word VBA codes for a long time. Your video was helpful in clearing my doubts.
You're super genius. I wanna learn more things about VBA for beginners.
Thank you for this. Great video and you are quite right, Word is so under represented.
It really is underrepresented; I wish more people would cover that and PowerPoint more. Even OneNote would be nice too.
Good job, very useful.
You've showed most essential parts
How set all the table in word document with left alligned.. And set width in "cm"
Very interesting tutorials. Would it be possible to split a document by a style (heading…) and save each part with all styles with the name of the heading ?
Excellent....
is there any changes require for VBA code for diff versions of MS Word? Also let me if we can connect on any code forum ??
We have application which opens template in diff MS word and office 365 but when we installed MS office 2016 or 2019 ver. It create issue.
need someone's help ?
I am not VBA programmer but its part of my project.
I am working with content controls and need the font in my drop-down menus to be grey before being selected, and then turn black when something is selected. Can I program that through VBA? (total beginner here)
Very useful! Thanks!
Not so default. I had to search for it in templates. It did not come up in the first several pages of templates. Probably a MS hic up as they always do. As good as I am programming in VBA for Excel and Access I never ventured into these statements. It is nice to see another side to VBA.
Is it possible to get the code of your example? Thanks
Can you help me to update a text at another place that i type at one place?
Can you give me an example of what you're trying to do?
@@SigmaCoding when i type a text under one heading part of it same should be typed under different heading as well which normally falls on different page. Which i mannualy copy and paste to another heading.
@@ramanjha5474 Gotcha, so that's a little complex, especially if it's not in the header and footer. If you know the number of ranges you want to edit beforehand, what you could do is add an event to document that would change all the ranges so that they all match. The problem is you would only want this event to be triggered if one of the ranges that are "linked" to the other ranges is modified.
Also, it would probably make sense that this is only executed once you have finished modifying the range. In other words, don't keep updating it as I'm typing only update the ranges after I'm finished editing.
I'm not very knowledgeable in programming but I'm trying to learn. So I've got a Word Document which is some sort of template. I made a little VBA GUI with Radio Buttons and Checkboxes. Based on the value selected, I would like to click on a button to replace bookmarked value or search for keywords within that word document template and replace these value with constant variable based on the selection choice.
ie:
First Name: (Textbox)
Last Name: (Textbox)
Diplomas: (Checkbox with choices; High School, College, University (University unlock more choices; Bachelor, Master, Doctorat)
Date of Graduation: (Textbox under date format)
Values are imported based on Word VBA GUI.
GUI had a Document_Open() function to Load my GUI form so when I open the doc, I get the GUI on top.
I make my selection and I am trying to fill chosen field in the document based on what the GUI captured...
I'm really tumbling right now and making very slow progress but I was wondering if you could give me a hand on that.
If I am understanding this correctly, you have a GUI that was built using VBA. That GUI has different components that display different pieces of information or allow a user to enter/choose different pieces of information. The user fills out your GUI, and you have a button that will "export" the values in the GUI to different parts of a Word Document template that you created.
However, you're struggling with the actual "exporting" of values from the GUI to the Document, correct? If that is the case, I need to see the actual code that you're using so I can see how everything is "talking to each other". If you don't mind could you please send all the code you currently have, along with a copy of the template so I can see how it's laid out to my email coding.sigma@gmail.com?
Ca you show me how to copy text using VBA on word? Like a button to copy a text rather than I select, copy and paste?
You showed how you can show the statistics of a document like how many characters are there in the document. But how can this function be used on the 'front' side of the document? So how can the user of the document use this? That's not clearing to me
Well, the statistics are available from the ribbon and some of them are displayed in the bottom. That's where the user could get them if needed.
Thank you for word vba videos. Would you be able to create a tutorial on the range object as it pertains to word vba. Thanks
Hi,
I have 1000 pages in word document
In that 1st page has two highlighted word in two different places
And I want to highlight rest 999 page at exact the same location ...
Can you please share the VBA code for that
What dose it mean vba without working with document?
Excellent video, helped me a lot. Can you please help me storing some strings in word document file using vba ? string will not be shown unless I run some code again to retrieve that string
Like you want to store the Words in like an array?
@@SigmaCoding Thanks for replying, my problem has been solved by viewing Microsoft docs. The currently problem I am facing is that I want to develop a website on which a user will upload a word document in "docx" format and will apply some operations (vba in the background) on the file and will download the file with the vba code applied. For such purpose, how can I use VBA in visual studio or any other web development IDE ?
How to code a command button to output question with selected radio button option on a SEPARATE document?
Ex.
How are you? (X) Good ( ) Bad -------> click Submit (command button ------> How are you? Good [separate document]
You want to modify one document based on the results of another document's radial button value? Is that correct?
@@SigmaCoding No, just open new separate document with the question and selected answer. Here's a link to the document I'm trying to create the command button for: pixeldrain.com/u/XYstXbgl
So only the selected answers & filled textboxes would go on a separate document with their respective questions and titles and all (ex. ACO blah blah). It's basically a new document with the exact same as this document, but only with the answers.
I need a Word Macro to convert selection text from this: This is a =selection in a word =document. To this: This is a s________ in a word d_______. Can anyone help me out?
I've tried
Sub conv_1()
Dim Sentence As String
Dim i As Integer
Sentence = Selection.Text
For i = 1 To Len(Sentence)
If Mid(Sentence, i, 1) Like "[a-zA-Z]" Then
Mid(Sentence, i, 1) = "_"
End If
Next i
Selection.Text = Sentence
End Sub
but it converts all the selected words to Dash-Dash-Dash.
I've also tried
Sub conv_2()
'Declare variables
Dim intCount As Integer
Dim intLength As Integer
Dim strInput As String
Dim strOutput As String
Dim strTemp As String
'Get the selected text
strInput = Selection
'If nothing is selected, exit
If strInput = "" Then
Exit Sub
End If
'Split the string into an array
Dim arrWords
arrWords = Split(strInput)
'Loop through each word in the array
For intCount = LBound(arrWords) To UBound(arrWords)
'Get the length of the word
intLength = Len(arrWords(intCount))
'If the word is longer than 1 character, convert the word
If intLength > 1 Then
strTemp = arrWords(intCount)
strOutput = strOutput & Left(strTemp, 1) & String(intLength - 2, "_") & _
Right(strTemp, 1) & " "
Else
'If the word is 1 character, add it to the output string
strOutput = strOutput & arrWords(intCount) & " "
End If
Next
'Trim the trailing space
strOutput = Trim(strOutput)
'Replace the original selection with the converted text
Selection.TypeText Text:=strOutput
End Sub
but it converts all words into A-Dash-A.
I don't know how to make it so that only the words that have an equal sign next to them get turned into A-Dash-Dash. I would appreciate any help on this!