cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Open a Document in MEGA through a Macro

mbergamini
MEGA
MEGA

Hi everybody,

I've created a MetaCommand which creates a document.

I'd like to open it (like with a double-click), but I could not find any clue on the articles.

 

Can anybody give me a hint?

 

 

Set oDoc = oMyProcess.NewDocument(oModDoc.GetProp("~210000000900[Name]"))
	If oDoc.refreshdocument = 0 Then
		'Open oDoc	
	End If

 

 

3 Replies

Hi,

 

If you are generating a word document, you can load the word application, get the path of document and automatically open it in word. No need to explore it

 

Something like this:

Set oDoc = oMyProcess.NewDocument(oModDoc.GetProp("~210000000900[Nom]"))
    If oDoc.refreshdocument = 0 Then
       Set objWord = CreateObject("Word.Application")
       objWord.Documents.Open(oDoc.GetProp("_Mdb_DocFilePath") & "\" & oDoc.GetProp("Nom"))
       objWord.Visible = True
       Set objWord = Nothing  
    End If

 

Regards,

Stephane

Ok,I'll explore the document and they'll open it by double click.

 

Thank you!

jhorber
MEGA
MEGA

Hi Martino

 

There is no method available to open an document in API script

It is possible to

  • Create a document (CreateDocument)
  • Initialize a document (InitializeDocument)
  • Detach a document (DetachDocument)
  • Refresh a document (RefreshDocument)

 

 

 

Jerome