[Solved] Inserting header

Using them, Making them, Finding them
Post Reply
sid_openoffice_1
Posts: 12
Joined: Tue Jun 15, 2010 1:53 pm

[Solved] Inserting header

Post by sid_openoffice_1 »

Hi,

I want to insert a header using data from a .ott(open document Text Template) file.
I am not getting a way to do this.
My .ott file contains tables too.
So please guide me the way of doing this.
Last edited by sid_openoffice_1 on Thu Jul 15, 2010 3:01 pm, edited 1 time in total.
Windows OpenOffice 3.2
User avatar
Hagar Delest
Moderator
Posts: 32658
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: inserting header

Post by Hagar Delest »

I fear we need some additional information!

What kind of data do you want to get? A template is used to create a document already pre-formatted so once the template is ready, the documents based on it should be fine from their creation.

If your template contains tables, then your documents get them too.

Can you upload it and tell us what's wrong (see: How to attach a document here)?
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
sid_openoffice_1
Posts: 12
Joined: Tue Jun 15, 2010 1:53 pm

Re: inserting header

Post by sid_openoffice_1 »

Actually i want to load that document in the header.
And I am not geting the way to do this.
Windows OpenOffice 3.2
User avatar
TheGurkha
Volunteer
Posts: 6482
Joined: Thu Mar 13, 2008 12:13 pm
Location: North Wales, UK.

Re: Inserting header

Post by TheGurkha »

You're going to have to give us more to work with!

Please tell us in more detail what you want to achieve, and what you have tried.
Ubuntu 14.10 Utopic Unicorn, LibreOffice Version: 4.3.3.2
Gurkha Welfare Trust
User avatar
keme
Volunteer
Posts: 3704
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: inserting header

Post by keme »

sid_openoffice_1 wrote:Actually i want to load that document in the header.
And I am not geting the way to do this.
That does not clarify anything. To provide any help, we need the following:
The document(s) you are working with (remove any sensitive data first). See link above for help with attaching files.
Tell us what you want to achieve.
Preferably, tell us what you have done (if you have gotten anywhere at all with this), and what result you got.
Apache OO 4.1.12 and LibreOffice 7.5, mostly on Ms Windows 10
sid_openoffice_1
Posts: 12
Joined: Tue Jun 15, 2010 1:53 pm

Re: inserting header

Post by sid_openoffice_1 »

Hi,

Please find the 2 attachment with this in which one is my code file and the other is the .ott file.
I want to insert the "TimeOffRequestForm.ott" file into the header.Is there a possibility of doing this?If yes please guide me how to do it.

Regards
Siddharth
Genpact
India
Attachments
TimeOffRequestForm.ott
this is the template file whch is to be used
(15.6 KiB) Downloaded 346 times
header inserting file.odt
this is my code file in c#.I want to insert the "TimeOffRequestForm.ott" file into the header.Is there a possibility of doing this?If yes please guide me how to do it.
(17.88 KiB) Downloaded 333 times
Windows OpenOffice 3.2
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Inserting header

Post by Zizi64 »

In my opinion that .ott file not contain any header. It might be called "Cover Page"

Why not you copy-paste your document into .ott file? Just type Ctrl-Enter in .ott file, and at beginning of second page paste the all text from .odt file, and on .ott file: save as...
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
sid_openoffice_1
Posts: 12
Joined: Tue Jun 15, 2010 1:53 pm

Re: Inserting header

Post by sid_openoffice_1 »

Hi,

Thanks for the reply bt i have to do that programmatically and in this i have to insert that .ott file into the header.

Regards.
Windows OpenOffice 3.2
User avatar
RoryOF
Moderator
Posts: 34613
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Inserting header

Post by RoryOF »

So long as your TimeOffRequest form is visible, does it matter if it is in the header, or on the first page?
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Inserting header

Post by Zizi64 »

Hi, sid_openoffice_1

An appropriate solution would be for you the following proposal?

Idea:
Automated autotext function

description:
First, highlight the text in the template file.
Pick up one into the "Autotext" function (Edit ->Autotext -> ...)
(I picked up named as "TORForm" with short name "T" in my OpenOffice.

The recorded macro will insert the into the (new) first page of the document.
On first page the macro will insert the autotext item named "T".

(The recorded macro stored in the BASIC repository of this document. You need to store into OpenOffice BASIC repository. Associate the macro to a new menu or the toolbar is a new element, then it will be always available.

(You can develop the macro. For example, to set the new first page to "First Page" pagestyle)

Code: Select all

REM  *****  BASIC  *****
Option Explicit

sub InsertFirstPage
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:GoToStartOfDoc", "", 0, Array())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:InsertPagebreak", "", 0, Array())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:GoToStartOfDoc", "", 0, Array())

rem ----------------------------------------------------------------------
dim args6(0) as new com.sun.star.beans.PropertyValue
args6(0).Name = "Group"
args6(0).Value = "mytexts*1"

dispatcher.executeDispatch(document, ".uno:SetActGlossaryGroup", "", 0, args6())

rem ----------------------------------------------------------------------
dim args7(1) as new com.sun.star.beans.PropertyValue
args7(0).Name = "Group"
args7(0).Value = "mytexts*1"
args7(1).Name = "ShortName"
args7(1).Value = "T"

dispatcher.executeDispatch(document, ".uno:InsertGlossary", "", 0, args7())

end sub
header inserting file.odt
(19 KiB) Downloaded 345 times
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Post Reply