Some questions about MS Word document creation

Hi,

I have a user knowledge database and I want to generate a curriculum vitae document in MS Word.

I never done this before so I don’t know if it’s possible the way I see it - there would be a button labelled “Generate CV”, which would open the MS Word application with generated document.

I searched the forum and msdn, and found some information, but I don’t know what exactly I should be looking for…

Is there any tutorial about creating and formatting a word document from notesdocument data somewhere on the internet? Or maybe you could give me some basic examples, which would help me to learn how to do it? I would be very thankful.

Regards,

M.G.

Subject: Some questions about MS Word document creation

do you want it in Java or Lotusscript?

Subject: RE: Some questions about MS Word document creation

I prefer it in lotusscript.

Regards,

M.G.

Subject: Some questions about MS Word document creation

I’d like to thank here all the people, who helped me with this issue. You people are great! :slight_smile:

Thank you.

M.G,

Subject: Some questions about MS Word document creation

If you have the Microsoft Office Visual Basic Help you have most information on properties and methodes for creating and formating Word-documents.

Here some examples:

Global declaration

Dim wrdApp As Variant

Dim wrdDocument As Variant

Dim MyRange As Variant

Sub subCreateWordObject

Set wrdApp = CreateObject(“Word.Application”)

wrdApp.Visible = True

wrdApp.StatusBar = “Word-document created…”

wrdApp.Documents.Add

Set wrdDocument = wrdApp.Documents(1)

With wrdDocument

.Content.Font.Name = “Times New Roman”

.Content.Font.Size = 10

End With

End Sub

Sub FillWordDocument

With wrdDocument

  .Content.InsertAfter Cstr(y) & ".  " & docResponse.TI(0)  & Chr(13) 

  Set myRange = .Paragraphs(.Paragraphs.count -1).Range

  myRange.Font.Bold = True	

  .Content.InsertAfter docResponse.AU(0) & Chr(13)

  Set myRange = .Paragraphs(.Paragraphs.count -1).Range

  myRange.Font.Italic =True

  .Content.InsertAfter docResponse.PJ(0) & " text: " & curDoc.field1(0) 

  If Not docResponse.OG(0)="" Then

  	.Content.InsertAfter " text " & docResponse.OG(0)

  End If

  .Content.InsertAfter Chr(13)	

  .Content.InsertAfter strString & " text " & Chr(13)

  .Content.InsertAfter "Status:"	& Chr(13)		

  



  .Content.InsertAfter "<some text>" & Chr(13)

  .Content.InsertAfter docResponse.ABN(0) & Chr(10) & Chr(10) 

  .Content.InsertAfter "<some text>": " & Chr(13) 

	

  Set myRange = .Paragraphs.Last.Range

  myRange.Collapse

  myRange.InsertBreak

	

  strTextTitle = "<my text>"

  .Content.InsertAfter strTextTitle & Chr(13) & Chr(13)

Set myRange = .Paragraphs(.Paragraphs.count -2).Range

With myRange

.Font.Bold = True

.Font.Size = 12

	

End With

End Sub

By looping trough your notes-documents you can create a Word-document with information of all notes-documents.

Hopes this get you on your way