For example, the field «LastName» would only contain people’s last names.Ī record is an entire set of data fields that relate to a single thing or person. Excel spreadsheets, Access databases, or Word document tables are good examples of data sources.Ī data category that stores a specific piece of information. For example, it has records containing the names and addresses of the people a mail merge letter is sent to. The starting document contains the field names for the variable information, like the names and addresses that will be inserted.Ī file that contains the information to be inserted into the main document during a mail merge. Again, thank you so much!! Really, i could not have crafted this without your help.(Main Document) A document that contains the information that is the same for each merged document. i would like to respect and follow the rules as much as i can, so if i am not giving enough detail or doing something abnormally, let me know so i can fix it. I have just shaved 20 minutes to an hour off EVERY transcript i complete as i was doing many of these corrections manually. Now, i can say, "Hey, Cortana, open finish job," and it will do this for me all automatically. The last step was to create a shortcut to FINISH.bat in C:\Users\Username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs called "Finish Job" for Cortana to index. The second-to-last step was to make a third bat file, FINISH.bat, which Cortana will be using, to call the two bat files: call "C:\Transcription\Transcription\In Progress\NewKCJob\FINISH-1.bat"Ĭall "C:\Transcription\Transcription\In Progress\NewKCJob\FINISH-2.bat" The next step was to tie them all together in Word in a certain order so that my find/replace macros i mentioned earlier also apply to "Rough.txt": Sub RunAllMacros() MsgBox "Bookmark ""rough"" does not exist!" Selection.InsertFile FileName:="C:\Transcription\Transcription\In Progress\NewKCJob\Rough.txt" Windows("Transcript.docx ").ActivateĪnd the following macro inserts my "Rough.Txt" document into the same transcript/Word document at the bookmark i inserted called "rough": Sub InsertRough() , SQLStatement:="SELECT * FROM `Submissions$`", SQLStatement1:="", _ "Provider=.12.0 User ID=Admin Data Source=C:\Transcription\Transcription\In Progress\JotformExport.xlsx Mode=Read Extended Properties=""HDR=YES IMEX=1 "" Jet OLEDB:System database="""" Jet OLEDB:Registry Path="""" Jet OLEDB:Engine Type=37 Jet " _ WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
"C:\Transcription\Transcription\In Progress\JotformExport.xlsx", _ĬonfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _ĪddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _ The following completes the mail merge for my Excel file, which is exported from Jotform. I made two more macros in Word which are relevant to my issue. So then I created about 20 find/replace Microsoft Word macros for styles which i will not post here since this was not relevant to the question. Then i have a second BAT file, FINISH-2.bat, which contains only the following: "C:\Program Files\Microsoft Office 15\root\office15\winword.exe" "/mRunAllMacros" "C:\Transcription\Transcription\In Progress\NewKCJob\Transcript.docx" I have a bat file with a bunch of FART commands in it to correct many common grammar errors in a document it's irrelevant and long, so i won't post it here.
So i used a combination of what all the answers were to construct the following: I have done this with other bats with great success. Important here is that it runs when i tell it to, not scheduled at a certain time. This is why i am going about it from this angle. Plus, if i can put it in an executable/"runnable" file like a bat or something similar, then i can attach a shortcut to it and run it with Cortana voice commands. I would like it to be simpler than opening word manually and running the macro. I would like this to be done by clicking run on a bat file or similar type of situation that does not involve me manually opening the file and clicking the buttons every time i want to do it. I would like to generate a DOC or DOCX from this scripting process that is saved in the same directory as the above-mentioned files. I have a "Rough.txt", the contents of which i would like to insert into a specific place in this same mail-merge-generated document in addition to the information from the Excel file. I have a Word template (dotm) that has fields i would like filled in from a one-line/entry Excel file.
Here is the problem from my original post: