
Step 1: Break the text string into different segments, separating the “?” characters: The solution to this is explained in the steps below: " f(x)=a_0+?_(n=1)^8n(a_n cos?npx/L?+b_n sin?npx/L? ) "Īs you can see a lot of the characters are not recognized by the VBA editor and are replaced by a “?” character. “f(x)=a_0+∑_(n=1)^∞▒(a_n cos〖nπx/L〗+b_n sin〖nπx/L〗 ) “īut this is what will happen if we try to make this replacement:.The first step would be to replace the text : For example lets say we want to create the equation explained at the start of the post. I will explain this in more detail in the following sections.įor more complex equations you can’t simply paste the text string in the VBA editor. So basically we need to be able to generate the text string in the notepad file to create the equation in word. Step 2: Select the text in the word document and click on the “Insert Equation” button on the “Insert” tabĪs you can see the equation was created from the text string in the notepad file. Step 1: Copy the text in the notepad editor and paste it in an empty word document: The text above can be converted back to a word equation by following the steps below: In order to create equations in word using VBA, we too will have the create the text string above. The text in the notepad might seem like nonsense, but the word editor understands this. If you copy the equation and paste it in a notepad this is what you get: For example take a look at the the equation below: You might not have noticed but equations in word are a basic text string. The first step for creating an equation in VBA for word is to determine the text string associated with that equation. Step 1, Getting the Text String Associated with the Equation:
