Hi all,
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.
thank you,
Karen
Launch Microsoft Word
-
- Founder/Site Admin
- Posts: 3473
- Joined: 24 Feb 2017, 09:12
- Location: Gouda, The Netherlands
Re: Launch Microsoft Word
Hi Karen,
Use WinApi function
Pass in the complete filename of the document and this will then be automatically opened in Word.
Use this sample:
WIKI_ShellOpenWith.zip
Use the browse button to select a .docm file and press OpenWith button.
Use WinApi function
ShellExecute
.Pass in the complete filename of the document and this will then be automatically opened in Word.
Use this sample:
WIKI_ShellOpenWith.zip
Use the browse button to select a .docm file and press OpenWith button.
Regards,
Dave Rabelink
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel
Dave Rabelink
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel
Re: Launch Microsoft Word
thank you very much, ShellExecute worked.
Re: Launch Microsoft Word
Hi!
I'm asking purely in self-interest as we might face the same problems.
Greetings, clem
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.
Greetings, clem
Re: Launch Microsoft Word
Hi Karen,
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?
Regards Thomas
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?
Regards Thomas
Re: Launch Microsoft Word
Hi all,
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.
Karen
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.
Karen
Re: Launch Microsoft Word
Hi Karen,
we also do mail merge. But we don't use autorun macros.
Instead we use the COM/ActiveX-functions from within gupta
to do all the mail merge.
Regards Thomas
we also do mail merge. But we don't use autorun macros.
Instead we use the COM/ActiveX-functions from within gupta
to do all the mail merge.
Regards Thomas
Who is online
Users browsing this forum: [Ccbot] and 1 guest