[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

document export to ms word

Posted on 2001-08-08
9
Medium Priority
?
245 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 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

834 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