Domino 9 und frühere Versionen > Entwicklung

notes to word - fehler

(1/3) > >>

luna:
hallo,

hab mir vor einiger zeit mal das notes to word script geladen, von diesem thread:

http://217.160.137.156/html/cgi-bin/yabb/YaBB.pl?board=002-2;action=display;num=1026985624;start=3

bis vor meiner langen abwesenheit hat das super geklappt, nur jetzt gehts nimmer, und ich weiss nicht, warum.

sachlage:
- ich hab lokal auf meiner platte ein word template, das rechnung_altPC.dot heisst. das hab ich nie veraendert, liegt dort auch immer noch. dort, wo auch die normal.dot ist.
- ich hab einen button in meine inventur DB eingebaut, der immer noch da ist und nicht veraendert wurde (ausser mir hat keiner designer).
dort steckt dieses script drin:
Sub Click(Source As Button)
     Dim s As New notessession
     Dim todaydate As New notesdatetime("Today")
     
     Dim workspace As New NotesUIWorkspace
     Dim uidoc As NotesUIDocument
     Set uidoc = workspace.CurrentDocument
     
     Dim word As Variant
     Dim wordoc As Variant
     
     Dim user As String
     Dim inventory_number As String
     Dim hardware As String
     
'Predefined values: (replace with field values from uidoc)
     todaysdate = todaydate.localtime      
     user = uidoc.FieldGetText("user")
     inventory_number = uidoc.FieldGetText("inventory_number")
     hardware = uidoc.FieldGetText("hardware")
     
'Create the Word object:
     Set word = CreateObject("Word.Application") 'Create Word object
     Call word.documents.add("Rechnung_altPC.dot") 'Create a new document based on the template "Return and Uplift.Dot"
     Set worddoc = word.activedocument 'Get a handle for the active document
     
'Assign the field values:
     
     worddoc.FormFields(3).result = todaysdate      
     worddoc.FormFields(4).result = user
     worddoc.FormFields(5).result = inventory_number
     worddoc.FormFields(6).result = hardware
     
     worddoc.saveas(user) 'save the document with the filename of "John Doe.doc"
     word.visible = True 'Comment this line if you don't want to show Word.
'word.quit 'remove comment if you want to close rather than show Word.
End Sub

wenn ich nun in meiner inventur DB auf den button "invoice" klicke, dann geht word nicht auf, und ich bekomme diese fehlermeldung in einem fenster:

Microsoft Word: This is not a valid file name.
Try one or more of the following:
*Check the path to make sure it was typed correctly
*Select a file from the list of files and folders

oder dann:

Micrsofot Word: Command failed

in meiner Task Liste steht dann winword.exe x-mal drin, aber es geht nicht wirklich auf.

was koennte denn da jetzt falsch laufen? ich kenn mich leider mit script nicht aus, und die fehlermeldung hilft mir auch nicht weiter.

danke und gruss,
daniela

Don Pasquale:
Hi Daniela,

> worddoc.saveas(user) 'save the document with the >filename of "John Doe.doc"


das kommt mir bekannt vor. Das hatte ich auch. Er speichert das Dokument mit _user_ ab, vielleicht hast Du was dran verändert und nur vergessen

Überprüfe mal, mit welchem Namen er das Dokument abspeichern möchte.


Gruß

Don Pasquale

luna:
hallo pasquale,

vielen dank, dass du mir hilfst. aber so einfach ist das nicht, fuer mich.

also, du sagst, ich soll nachschauen, unter welchem namen er es abspeichern will, aber wie soll ich denn da nachschauen? er oeffnet es ja nicht mal. und im explorer seh ich nix.

kann schon sein, dass ich was veraendert hab, und es nicht mehr weiss, aber ich glaube eher nicht. weil vor meiner langen abwesenheit gings noch, und waehrend dessen hab ich nix veraendert, und jetzt gehts auf einmal nimmer.

was kann ich denn noch tun / testen? was fuer infos brauchst du denn noch, um mir helfen zu koennen?

danke und gruss,
daniela

Don Pasquale:

Hi Dani,

gehe mal auf

Datei - Extra- und Debug Lotus Script

Jetzt versucht Du nochmal den Button Invoice aufzurufen
und klickst dann "Schritt ausführen" bis der Fehler nochmal kommt.

Unten sind 3 Reiter, Breakpoints,Variablen und Ausgabe.

Da gehst Du auf Variablen.

Welchen Wert hat das Feld user

Don Pasquale



luna:
hi pasquale,

also, ich hab das jetzt gemacht, mit dem debuger. und da kam die fehlermeldung wieder.

und in dem feld user steht "Andersen Michael" drin, also genau der name, der auch in dem feld "user" in der maske drin steht.

was nun?

gruss,
daniela

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln