Solved

document export to ms word

Posted on 2001-08-08
9
226 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
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 4

Accepted Solution

by:
sloeber earned 200 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Encrypted Mail message in a NSF 10 29
Creating a bat file fo Note.ini 4 199
IBM Enterprise Integrator - ZID File 1 168
attaching a file lotus notes 4 108
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

930 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now