?
Solved

document export to ms word

Posted on 2001-08-08
9
Medium Priority
?
237 Views
Last Modified: 2013-12-18
can someone tell me how to export information in a notes document to ms word.  i guess the template name will be c:\temp\text.doc.  

i need the code for notes and also how to setup the word template.

if you need more info please email me at samir_6@hotmail.com
0
Comment
Question by:SamirKumar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 4

Accepted Solution

by:
sloeber earned 800 total points
ID: 6367032
Here's an example of how you can do that
reate in your view an action, name it "ExportToWord"
Place into "Click" event this code:
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim idpath As String
Dim rtitem As NotesRichTextItem
Dim object As NotesEmbeddedObject
Dim wordobj As Variant
Dim add As String
Dim sal As String
Dim LastName As String
Dim FullName As String
' this code uses many of the Wordbasic commands in Word 97
'set up the word document

Set wordobj = CreateObject("Word.Basic.8")
If WordObj Is Nothing Then
Msgbox "There was a problem loading MS Word."
Exit Sub
End If

Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
For i = 1 To collection.Count
Set doc = collection.GetNthDocument( i )
Call session.UpdateProcessedDoc( doc )
'get the Address, Salutation , lastname and fullname fields from the current document

add=doc.MailAddress(0 )
sal=doc.Salutation(0)
LastName=doc.LastName(0)
FullName=doc.FullName(0)

' create new doc in MS Word
WordObj.filenew
wordobj.font "Univers"
wordobj.fontsize 11

wordobj.insertpara
wordobj.insertpara
wordobj.insertpara
wordobj.insertpara
wordobj.insertpara

' time format i.e 5 Febuary, 1999
DateTimeFormat="d MMMM, yyyy"

' inset the text and the field values
wordobj.insert "Our Ref:"
wordobj.insertpara
wordobj.insert "Your Ref:"
wordobj.insertpara
wordobj.insert "IPC:"
wordobj.insertpara
wordobj.insertpara
wordobj.insertpara


wordobj.insert "Date:"

wordobj.InsertDateTime DateTimeFormat
wordobj.insertpara
wordobj.insertpara
wordobj.insertpara
wordobj.underline
wordobj.insert "For the attention of : "
wordobj.insert Fullname
wordobj.underline
wordobj.insertpara
wordobj.insertpara

wordobj.insert add
wordobj.insertpara
wordobj.insertpara
wordobj.insertpara

wordobj.insert "Dear " & Sal & " " & Lastname
wordobj.insertpara
wordobj.insertpara

wordobj.insert "Subject:"
wordobj.insertpara
wordobj.insertpara


WordObj.fileSaveAs "myNew" & i & ".doc"
wordObj.fileClose

Next
Set WordObj = Nothing


End Sub

Greets,
Sloeber
PS : Thanks to stamp
0
 
LVL 4

Expert Comment

by:sloeber
ID: 6367041
If you have already a word template.
And you want just in a couple of fields from notes.
Like, if you'll write a letter to all the user.
The letter is the same only persons name is different.
Then you can make Bookmarks, where you want to have a notes field value.
Dim session as new notessession
dim db as notesdatabase
dim view as notesview
dim dc as notesdocumentcollection
dim doc as notesdocument
dim i as integer

Dim wordobj as variant
set wordobj = createobject("word.application.8)
wordobj.documents.open"c:/temp/tekst.doc"
word.obj.visible = True

set db=session.currentdatabase
set dc = db.unprocesseddocuments
for i=1 to dc.count
set doc = dc.getnthdocument(i)
................
................


Greets,
Sloeber
0
 

Author Comment

by:SamirKumar
ID: 6367710
how do i setup the word file....

samir
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 4

Expert Comment

by:sloeber
ID: 6367767
In which example
In the first example, you must do nothing
In the second just make a word document and save it, and use the same name of your document in your code
that's all

greets,
sloeber
0
 

Author Comment

by:SamirKumar
ID: 6369903
can you send me a database with it and the word template...

if i have four field (name, age, ssn, and id) in a view and I want the template to look like:

Name (Notes Field)
Age (Notes Field)......

I must have to put some data inside the word template to expect different values.

if you email the stuff to samir_6@hotmail.  please zip the files.  thanks
0
 
LVL 4

Expert Comment

by:sloeber
ID: 6371536
Samir,

I've send you a database and a word document.
If you open it, just choose a document in the view, and choose then Action >> Export to Word

You can always update the agent.
I've made it very fast so it isn't perfect written, but it works ;-)

There are also other method to work with, like FX and so...
But why look to other method, if this one works.

Greets,
Sloeber
0
 

Expert Comment

by:giusepe
ID: 6372998
Slober, could you send me this database with the template that you sent to Samir to my email ??

if you are agree, please send it to
 technobambino@yahoo.com

Thanks and regards
0
 

Expert Comment

by:giusepe
ID: 6373002
i forgot,

or if you already have it Samir, could you send the database and the template to my email wrote in the comment above ???
0
 

Expert Comment

by:DavidAbbott
ID: 8326278
Is there a way to include any attachments in the Notes doc as well?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question