PDA

View Full Version : template:header/footer disappears in new document



questfar
08-11-2008, 07:08 AM
I have a template that I am accessing prgrammatically and populating bookmarks. When I open the new document, I can't see the header/footer. I have to do VIEW-->Header/Footer. I can't find properties to set to make the header/footer visible.

Any Ideas??

TIA

parttime_guy
08-11-2008, 07:40 PM
Can u post a sample file.

macropod
08-12-2008, 03:26 AM
Hi questfar,

Is Word using 'page layout' view when you open the document? If not, try enabling it.

If you're using Word 2003 or later, is 'Reading Layout' enabled (in Word 2003, see under Tools|Options|General)? If so, try disabling it.

Does the document open with the top of the page visible? If not, try scrolling to the start of the document (eg Ctrl-Home).

questfar
08-12-2008, 04:07 AM
Hi All,
Here is the code and the file I'm using. Bear in mind that this is LotusScript being run form a Lotus Notes Client so it is NOT strict VBA. This code works properly and it is the only code manipulating the Word document.
Informe1.doc is being used as the "template". When I open this document the header and footer are displayed, when I use the document in the code and save as a new document, the new document does not display the header/footer. All settings in Word remain the same.

(just posting the code that manipulates the word doc, very simple code just adding data to bookmarks)
Call wdObject.ActiveDocument.Bookmarks("cliente").select

Call wdObject.Selection.TypeText(cliente(0))
Call wdObject.ActiveDocument.Bookmarks("compania").select
Call wdObject.Selection.TypeText(compania(0))
Call wdObject.ActiveDocument.Bookmarks("cliente2").select
Call wdObject.Selection.TypeText(cliente(0))
Call wdObject.ActiveDocument.Bookmarks("keywords").select
Call wdObject.Selection.TypeText(keywords(0))
Call wdObject.ActiveDocument.Bookmarks("fecha").select
Call wdObject.Selection.TypeText(Format(createDate$,"d/mm/yyyy"))
Call wdObject.ActiveDocument.Bookmarks("grupo").select
Call wdObject.Selection.TypeText(grupo(0))
Call wdObject.ActiveDocument.Bookmarks("oficina").select
Call wdObject.Selection.TypeText(sede(0))


fileDT$=Format(createDate$,"Medium Date") & " " &Format(createTime$,"h")_
& "-" &Format(createTime$,"n") & "-" &Format(createTime$,"s")& " " &Format(createTime$,"AM/PM")
Call wdSaveAs(sMyDocs & "\Word\test" & fileDT$ & ".doc")

Call wdCloseDocument

Call wdQuit

thanks,