What is the best way to call Word (with a file that needs to be launched) from Team Developer, not using ActiveX?
For very many years, we successfully ran an implementation using ActiveX to launch Microsoft Word for mail merges. Security patches applied recently to the operating system and/or Office cause ActiveX to be stopped. So I changed the call to
If NOT SalLoadApp( 'cmd /c '||fsTempFile, '' )
Call SalMessageBox(' Failure attempting to run cmd/c '||fsTempFile, 'Application Did Not Launch', MB_Ok )
where fsTempFile is a Word document of type .docm (with macros)
Now the problem is that the command window is open, the merge happens, but because the VB macro is written to close the source document, leaving only the new merged document on the screen, it looks like a blank document on the screen, with all icons and ribbons greyed out. I can save the visually blank file, then open it, and all the text is correctly there.
I tried to comment out the close source document line in the VB, but that isn't the right approach because the end user will not know to do all the right keystrokes.
- Founder/Site Admin
- Posts: 400
- Joined: 24 Feb 2017, 09:12
- Location: Gouda, The Netherlands
Use WinApi function
Pass in the complete filename of the document and this will then be automatically opened in Word.
Use this sample:
Use the browse button to select a .docm file and press OpenWith button.
Would you mind going into more detail as to what precisely caused Word/ActiveX to stop working?
I'm asking purely in self-interest as we might face the same problems.
we use TD 7.0.2 32-Bit together with Office 2016 32 Bit on Windows 10 Pro 64-Bit.
All Windows software is up to date.
We don't face any problems starting Word via COM.
Could you please describe your issues?
[ frevel & fey ] Software-System GmbH
The Word documents in question have an autorun macro and other mail merge code in macros. Non-macro Word still works with ActiveX. The client site is Windows7 64bit, Office 2010.
I don't know why it stopped working or what security measures were implemented. It was at a client site. Their IT department did not tell me what was applied over that weekend. I was told the letters not launching was the way Word was invoked.
Sorry I don't have more information.
Who is online
Users browsing this forum: Ccbot [Crawler] and 0 guests