![]() |
KnowBrainer Speech Recognition | ![]() |
Topic Title: Vocola Procedure for Microsoft Word? Topic Summary: Need help in drafting a Vocola procedure for Microsoft Word Created On: 01/22/2022 12:59 PM Status: Post and Reply |
|
![]() |
![]() |
- Matt_Chambers | - 01/22/2022 12:59 PM |
![]() |
![]() |
- mdl | - 01/22/2022 08:58 PM |
![]() |
![]() |
- Matt_Chambers | - 01/23/2022 07:50 AM |
![]() |
![]() |
- mdl | - 01/23/2022 01:26 PM |
![]() |
![]() |
- mdl | - 01/23/2022 01:27 PM |
![]() |
![]() |
- mdl | - 01/23/2022 01:34 PM |
![]() |
![]() |
- Matt_Chambers | - 01/23/2022 05:08 PM |
![]() |
![]() |
- Matt_Chambers | - 01/30/2022 12:49 PM |
![]() |
![]() |
- mdl | - 09/02/2022 04:28 PM |
![]() |
![]() |
- Matt_Chambers | - 09/03/2022 03:36 PM |
![]() |
|
If you've created a successful Vocola Procedure for controlling Microsoft Word, I'd love to see it. I've been trying to write one for couple of days now, but it keeps giving me an error message to the effect of: vocola_ext_Word.py:12: Error: Vocola extension specification line not followed by a def name(... line I've been using the official Vocola extension for Microsoft Excel as a model, but can figure out the right wording for Microsoft Word. My goal is to have a procedure that will run any Microsoft Word macro that I have created. |
|
|
|
![]() |
|
can you please post the text around line 12?
|
|
|
|
![]() |
|
Yes, of course:
12 # Vocola procedure: Word.RunMacro 13 def run_macro(mConvertFootnotes): 14 xlApp = open_Word() 15 xlApp.Application.Run(mConvertFootnotes) No more code after line 15. |
|
|
|
![]() |
|
weird, I created a extension with just: # Vocola procedure: Word.RunMacro def run_macro(mConvertFootnotes): xlApp = open_Word() xlApp.Application.Run(mConvertFootnotes)
and it worked fine for me. |
|
|
|
![]() |
|
the relevant matching code is: m = re.search(r'^\s*def\s+([^(]+)\(([^)]*)', second_line) if m == None: error(("%s.py:%d: Error: Vocola extension specification line " + "not followed by a def name(... line") % (extension, line_number)) I'm not seeing any reason why that would not match
|
|
|
|
![]() |
|
one idea: are you using the Windows line ending convention? (\r\n)
I tried switching to just \n's and that still worked maybe just \r's breaks? |
|
|
|
![]() |
|
Thanks for the suggestions. I will play around with it tomorrow and see if I can figure out the issue.
|
|
|
|
![]() |
|
I seem to have gotten past the initial issue, by simply deleting the extension and starting over. Don't ask me to explain that.
Am having some issues with the VBA code, but I'll figure it out eventually. |
|
|
|
![]() |
|
FYI, I have had luck creating VBA macros in word and binding them to keyboard shortcuts and then calling them from Vocola.
|
|
|
|
![]() |
|
Thanks, but I don't want to do have to assign keyboard shortcuts to the macros. I'll just stick with Advanced Scripting. |
|
|
FuseTalk Standard Edition v4.0 - © 1999-2023 FuseTalk™ Inc. All rights reserved.