-----Ursprüngliche Nachricht-----
Von: Johannes A. Bodwing [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 12. Juli 2007 16:05
An: [email protected]
Betreff: [de-users] Writer-Dokument per Makro öffnen


Hallo Leute,
kann ich ein Writer-Dokument mittels Makro öffnen?
.....
Gruß,
Johannes

Kleiner Hinweis zu makros(basic)
http://www.dannenhoefer.de/faqstarbasic/


oder ein Stückchen von meinem Code aus einer calc-Anwendung (ohne Gewähr!)
....
rem - Vorlage je nach Tabellenanwendung aus optionen
strTemplate =  oSheet.getCellByPosition(8,1).string & "-" &
mySheet.getCellByPosition(1,3).string
strDataPath = mySheet.getCellByPosition(1,9).string     '"C:\Dokumente und
Einstellungen\kgs\Eigene Dateien\...."

 strDatei =  strDataPath + "\" + strTemplate
 sSourceFile = converttourl(strDatei)

 strTmp= strNo   'Nummer vorher eingelesen

 strTitle =   left(oSheet.getCellByPosition(3,intRow).string,15)
 strTitle =  ReplaceString(strTitle, "_","\")
 strTitle =  ReplaceString(strTitle, "_","/")
 strTitle =  ReplaceString(strTitle, "_",":")
 strTitle =  ReplaceString(strTitle, "_","?")
 strTitle =  ReplaceString(strTitle, "_",",")

 strTmp =strTmp & "_" & strTitle

'Zuordnung des Namen zum Thema des sheets, Nummer und evtl Kurztext
 strTmp =oSheet.getCellByPosition(intColumn,1).string + "_" + strTmp


 strDatei=strDataPath + "\"+ strTmp + ".odt"
 strDateiurl=converttourl(strDatei)

 Dim myFileProp(0) As New com.sun.star.beans.PropertyValue
 myFileProp(0).Value = False
 if FileExists(dateiurl) then
        oDocument = oDesktop.loadComponentFromURL( strDateiurl, "_blank",
0,myFileProp() )
 else
        rem ---neu anlegen
        oDocument = oDesktop.loadComponentFromURL( sSourceFile, "_blank",
0,myFileProp() )
      oDocument.storeasurl(strDateiurl,dummy())
 end if
.......


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Antwort per Email an