do you have any Idea please ? TIA
This is the code :
integer result, nInd
OLEObject oServiceManager
OLEObject oDesktop, oDocument, oProperty[0 to
6],oCoreReflection, oMailMerge
any aArgs[0 to 6]
oServiceManager = CREATE OLEObject
result =
oServiceManager.ConnectToNewObject("com.sun.star.ServiceManager")
oDesktop =
oServiceManager.createInstance("com.sun.star.frame.Desktop")
oMailMerge =
oServiceManager.createInstance("com.sun.star.text.MailMerge")
nInd = 0
oProperty[nInd] =
oServiceManager.Bridge_GetStruct("com.sun.star.beans.PropertyValue")
nInd = nInd + 1
oProperty[nInd] =
oServiceManager.Bridge_GetStruct("com.sun.star.beans.PropertyValue")
............................
nInd = nInd + 1 // nInd = 6
oProperty[nInd] =
oServiceManager.Bridge_GetStruct("com.sun.star.beans.PropertyValue")
nInd = 0
oProperty[nInd].Name = "DataSourceName"
oProperty[nInd].Value = "Scop"
aArgs[nInd] = oProperty
nInd = nInd + 1
oProperty[nInd].Name = "CommandType"
oProperty[nInd].Value = 0
aArgs[nInd] = oProperty
nInd = nInd + 1
oProperty[nInd].Name = "Command"
oProperty[nInd].Value = "Dcir_scop"
aArgs[nInd] = oProperty
nInd = nInd + 1
oProperty[nInd].Name = "DocumentURL"
oProperty[nInd].Value =
"file:///C:/Sequoia32/document/Let_type/Scop/Parapheur/CircuitParaph/FeuilleRoute5Attrib.ott"
aArgs[nInd] = oProperty
nInd = nInd + 1
oProperty[nInd].Name = "OutputType"
oProperty[nInd].Value = 2
aArgs[nInd] = oProperty
nInd = nInd + 1
oProperty[nInd].Name = "OutputURL"
oProperty[nInd].Value = "file:///C:/Fusion/"
aArgs[nInd] = oProperty[nInd]
nInd = nInd + 1
oProperty[nInd].Name = "FilePrefixName"
oProperty[nInd].Value = "auto"
aArgs[nInd] = oProperty[nInd]
oMailMerge.Execute(aArgs)
oServiceManager.disconnectobject( )
//oDocument.storeAsURL("file:///C:/Fusion/montestole.odt",
aArgs)
//oDocument.Close(true);
//oDesktop.Terminate;