Hi,
I did a long search but did not find a solution to a small problem:
I create a word document form a template and embed it in a richtext field. I feed it with data and then I would like to show the document for further editing.
Everything works fine, but with never versions of Office, since 2010 I think, the document is not displayed (brought to front) but the user has to click on the word document icon in the taskbar. This is annoying.
The code that worked but not anymore is as follow:
Call uidoc.GotoField( “documentFile” ) 'Embed file in a rich text field
Call uidoc.CreateObject(“Word Document”,“”,path) 'Create an OLE object
Set WordObj = uidoc.GetObject(“Word Document” ) 'Returns a handle to the OLE object
more code …
ok, that works, but then I would like to pop up the word document to show it to the user:
WordObj.activate
WordObj.Fields.Update ’ Update fields, eg. the address in a letter,…
WordObj.Application.WindowState = 1
WordObj.Application.Visible = True ’ ← this does not work anymore
WordObj.Application.Activate
Can somebody tell me what is now wrong or how I can bring the document to front.
Many thanks in advance.
fm