I have the code below running as an agent to export contents of a web form into a word document. I want to tweak the code so that it will format the contents of the fields it brings to word in the same format as they appear on the web form. I want it to preserve the paragraphs, bullets or numbering as they appear on the web form. Currently it brings everthing accross and wraps up the fields content as one paragraph.
Dim ses As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim descItem As NotesItem
Dim sumItem As NotesItem
Dim specItem As NotesItem
On Error Goto errhandle
Set doc = ses.DocumentContext
v_docid$ = Strright(doc.Query_String_Decoded(0), “&”)
If Isnull(v_docid$) Or v_docid$ = “” Then
Print ||
Exit Sub
End If
Set db = ses.CurrentDatabase
Set lookupdoc = db.GetDocumentByUNID(v_docid$)
Set descItem = lookupdoc.getfirstitem(“desc”)
Set sumItem = lookupdoc.getfirstitem(“summary”)
Set specItem = lookupdoc.getfirstitem(“specs”)
Print |Content-Type:application/vnd.ms-word|
Print |Content-Disposition: attachment; filename=“preq.doc”|
Print ||
Print |
XYZ COMPANY LIMITED|
Print |JOB DESCRIPTION|
Print |
TITLE: | & lookupdoc.title(0)
Print |
DEPT: | & lookupdoc.dept_name(0)
Print |
FLSA: | & lookupdoc.flsa(0)
Print |
REPORTS TO: | & lookupdoc.reports_to(0)
Print |
|
Print |
General Summary:|
Print |
| & sumItem.text
Print |
|
Print |
Principal Duties and Responsibilities: |
Print |
| & descItem.text
Print |
|
Print |
Job Specifications (education, years of professional experience,technical skills, etc)|
Print |
| & specItem.text
Print |
|
Print ||
Dim alog As New NotesLog( “My Agent Log” )
Call alog.OpenAgentLog
Call alog.LogAction( “Error:” & Error & " has occured on line: " & Erl )
Call alog.Close
Print ||
Exit Sub
End Sub
Heres the results of the word document. You can clearly see how the script just wraps up the content as one paragraph and does not format it properly on word observing paragraphs, bullets or numbering.
Please Help
TITLE: Administrative Assistant- temporary
DEPT: Marketing Administration
FLSA: Exempt
REPORTS TO: Tony Montana
General Summary:
Administrative Assistant to Tony Montana. Duties include, typing, scheduling meetings in Lotus Notes, completing and checking expense reports, faxing, copying, typing minutes, send out mail and fed ex packages both domestic and international, prepare for meetings by making coffee and if need be ordering lunches, and answering phones for Tony Montana. Assist Marketing department with admin duties.
Principal Duties and Responsibilities:
see detailed summary attached - answering incoming calls - open and sort business related mail -support to marketing and International operations - time and attendance tracking, vacation approval tracking;- set up of numbers in JDE related to spec routing, forecasting, RPAF’s etc. - coordination of trael arrangements - Sample Requests processing - requesting Art Images expense reporting processing - supply requests -help tickets requests - calendar management for Kevin and Chris - processing Federal Express / USPS
Job Specifications (education, years of professional experience,technical skills, etc)
Education: High School graduate, some college preferred;Experience: over 5 years administrative/executive experience. ;Excellent typing skills and good knowledge of PC and Lotus Notes and e-mail.;Excellent communication and written skills.;Willingness to work on a team and independently.