Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext


Jason Sas 19.May.08 08:15 PM a Web browser
Domino Designer 6.5.6; 6.5.5 FP3; 6.5.5 FP2; 6.5.5 FP1; 6.5.5; 6.5.4 FP3; 6.5.4 FP2; 6.5.4 FP1; 6.5.4; 6.5.3 FP2; 6.5.3 FP1; 6.5.3; 6.5.2 FP1; 6.5.2; 6.5.1; 6.5 Windows XP


Hi,

I'm trying to modify a piece of code and word template that was previously created. Basically the code accesses a Word template saved to a field on a document and then replaces certain values such as title, person assigned etc. I'd like to move some of the values in the Word document to the Header/Footer, but as soon as I do this the code doesn't replace the values (ie, it looks like it can't see those variables on the Word document). Is there anyway to move these values to the Header/Footer on the Word document and still let Notes be able to see them? See my sample code below:

Function EditBriefDocument(COAGDocument As NotesDocument) As NotesDocument
'CreatebriefDocument

'Parameters
'PPQDocument : The Document that the brief is being created for.

'Description
'This function will create/edit a brief document for the specified PPQ document.
Dim BriefTemplate As Variant
Dim OutputPath As String

Dim LeadBranch As String
Dim Branchheads As Variant

Dim PolicyOfficerNo As String
Dim BranchManagerNo As String


Dim Session As New NotesSession
Dim BriefDocument As NotesDocument
Dim BriefEmbeddedField As NotesRichTextItem

Dim WorkSpace As New NotesUiWorkSpace
Dim AuthorsList As NotesItem
Dim ReadersList As NotesItem

If BriefExists(COAGDocument, BriefDocument) Then
If Not BriefDocument Is Nothing Then
Set EditBriefDocument = BriefDocument
Exit Function
End If
End If

'// Get the Branch managers phone number and insert it into the document
'// Insert common name of the Branch manager into the document
LeadBranch = GetLeadBranch(COAGDocument)
BranchHeads = GetBranchField(LeadBranch, "BranchHeads")
BranchManagerNo = GetNADocField(GetCanonicalName(Cstr(BranchHeads(0)) ), "OfficePhoneNumber")(0)

'// Get the the Policy officer's phone number and insert it into the document
PolicyOfficerNo = GetNADocField(GetCanonicalName(COAGDocument.PolicyOfficer(0)), "OfficePhoneNumber")(0)

'// Get the index template document
Set BriefTemplate = GetTemplateDocument ("COAGTemplate", OutputPath)

'// Insert the topic of the PPQDocument into the brief document
' BriefTemplate.EditReplace "%TOPIC%", Ucase(Cstr(COAGDocument.Topic(0))), 0, 0, 1, 0, 0, 0, 0, 1, 0, 0

BriefTemplate.EditReplace "%SUBMISSIONNBR%", Ucase(Cstr(COAGDocument.SubmissionNbr(0))), 0, 0, 1, 0, 0, 0, 0, 1, 0, 0

'// Insert the subject of the PPQDocument into the brief document
' BriefTemplate.EditReplace "%SUBJECT%", Ucase(Cstr(COAGDocument.Subject(0))), 0, 0, 1, 0, 0, 0, 0, 1, 0, 0

BriefTemplate.EditReplace "%SUBTITLE%", Ucase(Cstr(COAGDocument.Title(0))), 0, 0, 1, 0, 0, 0, 0, 1, 0, 0

'// Insert the common name of the Policy officer into the brief
BriefTemplate.EditReplace "%POLICYOFFICER%", CommonName(Cstr(COAGDocument.LeadBriefingOfficer(0))), 0, 0, 1, 0, 0, 0, 0, 1, 0, 0

BriefTemplate.EditReplace "%BRANCHMANAGER%", CommonName(Cstr(BranchHeads(0))) , 0, 0, 1, 0, 0, 0, 0, 1, 0, 0

BriefTemplate.EditReplace "%POLICYOFFICERNO%", PolicyOfficerNo, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0

BriefTemplate.EditReplace "%BRANCHMANAGERNO%", BranchManagerNo, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0

'// Get the create date of the brief, format it into dd month yyyy and insert it into the document
BriefTemplate.EditReplace "%Date%", Format(Date$ , "dd/mm/yy"), 0, 0, 1, 0, 0, 0, 0, 1, 0, 0

'// Turn off set summary info
BriefTemplate.ToolsOptionsSave 0, 0, 0

BriefTemplate.FileSaveAs OutputPath, 0
'BriefTemplate.FileClose 2
BriefTemplate.FileExit 2

'// Create the notes index document in the database
Set BriefDocument = New NotesDocument(Session.CurrentDatabase)
BriefDocument.Form = "COAG Document"

Set ReadersList = New NotesItem(BriefDocument, "ReadersList", COAGDocument.ReadersList,Readers)
Set AuthorsList = New NotesItem(BriefDocument,"AuthorsList", COAGDocument.PolicyOfficer,Authors)
BriefDocument.ReadersList = COAGDocument.ReadersList
BriefDocument.AuthorsList = COAGDocument.AuthorsList
BriefDocument.ParentDocUniqueId = COAGDocument.DocumentID
BriefDocument.EditMode = "Read"
BriefDocument.VersionNumber = 0
Set BriefEmbeddedField = New NotesRichtextItem(BriefDocument,"BriefDocument")
Call BriefEmbeddedField.EmbedObject (EMBED_OBJECT, "", OutputPath, "Brief.doc")
Call BriefDocument.makeResponse(COAGDocument)
Call BriefDocument.Save(False,False)

If Not BriefDocument Is Nothing Then
Set EditBriefDocument = BriefDocument
Else
Set EditBriefDocument = Nothing
End If

End Function








  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow