| View previous topic :: View next topic |
| Author |
Message |
Des Tuff Guest
|
Posted: Tue Sep 27, 2005 6:04 am Post subject: WORD_TLB Type Library Compilation Error |
|
|
I am writing an application which writes to a Microsoft Word
document. To set up the OleAutomation I have imported the
Microsoft Word 11 Object Library available under "Import Type Library".
Once I include WORD_TLB in my uses clause and compile
I get a compilation error.The error message reports unknown
variable declarations for many of the function return variables
in the WORD_TLB.pas unit.
Is there another unit I must include in the Uses clause?
How do I fix this?
Rgds Des Tuff
|
|
| Back to top |
|
 |
Oliver Townshend Guest
|
Posted: Tue Sep 27, 2005 6:26 am Post subject: Re: WORD_TLB Type Library Compilation Error |
|
|
| Quote: | I am writing an application which writes to a Microsoft Word
document. To set up the OleAutomation I have imported the
Microsoft Word 11 Object Library available under "Import Type Library".
Once I include WORD_TLB in my uses clause and compile
I get a compilation error.The error message reports unknown
variable declarations for many of the function return variables
in the WORD_TLB.pas unit.
Is there another unit I must include in the Uses clause?
How do I fix this?
|
I don't have my PC with Delphi/Office available at the moment, but I think
there is an office_tlb unit as well.
Posting at least one error example would be useful.
Oliver Townshend
|
|
| Back to top |
|
 |
Des Tuff Guest
|
Posted: Tue Sep 27, 2005 11:03 am Post subject: Re: WORD_TLB Type Library Compilation Error |
|
|
Hi
I tried including Office_TLB and VBIDE_TLB in the units clause
with no luck.
A typical compilation error line in Word_TLB is ...
function Get_AutomationSecurity: MsoAutomationSecurity; safecall;
with the error message....
[Error] Word_TLB.pas(5392): Undeclared identifier: 'MsoAutomationSecurity'
Thanks for help
Des Tuff
|
|
| Back to top |
|
 |
Oliver Townshend Guest
|
Posted: Tue Sep 27, 2005 11:10 am Post subject: Re: WORD_TLB Type Library Compilation Error |
|
|
| Quote: | A typical compilation error line in Word_TLB is ...
function Get_AutomationSecurity: MsoAutomationSecurity; safecall;
with the error message....
[Error] Word_TLB.pas(5392): Undeclared identifier: 'MsoAutomationSecurity'
|
Have you imported the Type Libraries, or you using the ones that come with
Delphi? And what version of Delphi and Office are you using?
Oliver Townshend
|
|
| Back to top |
|
 |
Mike Shkolnik Guest
|
Posted: Tue Sep 27, 2005 11:40 am Post subject: Re: WORD_TLB Type Library Compilation Error |
|
|
What Delphi version do you use? As I remember, the Delphi 6 (without
updates) have the bug in Type Library importing.
--
With best regards, Mike Shkolnik
EMail: [email]mshkolnik (AT) scalabium (DOT) com[/email]
http://www.scalabium.com
"Des Tuff" <des (AT) infodeck (DOT) co.za> wrote
| Quote: |
I am writing an application which writes to a Microsoft Word
document. To set up the OleAutomation I have imported the
Microsoft Word 11 Object Library available under "Import Type Library".
Once I include WORD_TLB in my uses clause and compile
I get a compilation error.The error message reports unknown
variable declarations for many of the function return variables
in the WORD_TLB.pas unit.
Is there another unit I must include in the Uses clause?
How do I fix this?
Rgds Des Tuff
|
|
|
| Back to top |
|
 |
Des Tuff Guest
|
Posted: Tue Sep 27, 2005 12:28 pm Post subject: Re: WORD_TLB Type Library Compilation Error |
|
|
Hi
I imported the type libraries into the project from the selectable list in delphi using the Project/Import Type Library option. I'm using Delphi6.
It is Microsoft Office Word 2003 (11.5604.5606)
Part of Microsoft Office Professional Edition 2003
Des Tuff
|
|
| Back to top |
|
 |
Des Tuff Guest
|
Posted: Tue Sep 27, 2005 12:36 pm Post subject: Re: WORD_TLB Type Library Compilation Error |
|
|
Hi Mike,
I am using Delphi 6.Usually when we install Delphi on a new PC
we install all the upgrades but this was a new laptop and I
did not do the installation. I will check. We have update 1
and 2 is there more?
Thanks again
Des Tuff
|
|
| Back to top |
|
 |
Mike Shkolnik Guest
|
Posted: Tue Sep 27, 2005 1:05 pm Post subject: Re: WORD_TLB Type Library Compilation Error |
|
|
Just install updates and after that you'll import the type library without
errors.
--
With best regards, Mike Shkolnik
EMail: [email]mshkolnik (AT) scalabium (DOT) com[/email]
http://www.scalabium.com
"Des Tuff" <des (AT) infodeck (DOT) co.za> wrote
| Quote: |
Hi Mike,
I am using Delphi 6.Usually when we install Delphi on a new PC
we install all the upgrades but this was a new laptop and I
did not do the installation. I will check. We have update 1
and 2 is there more?
Thanks again
Des Tuff
|
|
|
| Back to top |
|
 |
Des Tuff Guest
|
Posted: Tue Sep 27, 2005 1:33 pm Post subject: Re: WORD_TLB Type Library Compilation Error |
|
|
Hi Mike,
I re did the upgrades and removed and reinstalled the MicroSoft
Word library and that seemed to do the trick.
Thanks very much for the help
Best Rgds
Des Tuff
PS I don't suppose you know how to include tables in a rtf
document. I want to be able to left align the text and right
align the numbers in an invoice but I cannot seem to be able
to insert a table.
I've tried creating the layout in Word and then saving to and
rtf but it just go all over the place.
Thanks again.
|
|
| Back to top |
|
 |
Des Tuff Guest
|
Posted: Tue Sep 27, 2005 1:33 pm Post subject: Re: WORD_TLB Type Library Compilation Error |
|
|
Hi Mike,
I re did the upgrades and removed and reinstalled the MicroSoft
Word library and that seemed to do the trick.
Thanks very much for the help
Best Rgds
Des Tuff
PS I don't suppose you know how to include tables in a rtf
document. I want to be able to left align the text and right
align the numbers in an invoice but I cannot seem to be able
to insert a table.
I've tried creating the layout in Word and then saving to and
rtf but it just go all over the place.
Thanks again.
|
|
| Back to top |
|
 |
Des Tuff Guest
|
Posted: Tue Sep 27, 2005 1:36 pm Post subject: Re: WORD_TLB Type Library Compilation Error |
|
|
Hi Mike
That seems to have worked.
Thanks very much
Best Rgds
Des Tuff
PS Don't suppose you know how to include a table in a rtf file?
|
|
| Back to top |
|
 |
Mike Shkolnik Guest
|
Posted: Tue Sep 27, 2005 2:47 pm Post subject: Re: WORD_TLB Type Library Compilation Error |
|
|
| Quote: | PS Don't suppose you know how to include a table in a rtf file?
Do you mean to insert into the TRichEdit or do you need the syntax for |
rtf-format?
I added the tables in my SMExport but there I don't use the TRichEdit. I
creates the rtf-file on-fly.
--
With best regards, Mike Shkolnik
EMail: [email]mshkolnik (AT) scalabium (DOT) com[/email]
http://www.scalabium.com
|
|
| Back to top |
|
 |
Oliver Townshend Guest
|
Posted: Tue Sep 27, 2005 3:31 pm Post subject: Re: WORD_TLB Type Library Compilation Error |
|
|
| Quote: | PS I don't suppose you know how to include tables in a rtf
document. I want to be able to left align the text and right
align the numbers in an invoice but I cannot seem to be able
to insert a table.
I've tried creating the layout in Word and then saving to and
rtf but it just go all over the place.
|
That shouldn't happen. Do you have the auto-size columns option on?
Oliver Townshend
|
|
| Back to top |
|
 |
Des Tuff Guest
|
Posted: Tue Sep 27, 2005 4:09 pm Post subject: Re: WORD_TLB Type Library Compilation Error |
|
|
Hi Oliver,
Let me expand on what I'm trying to do. I was using a rtf file
as an invoice template and replacing the tags with the amounts
etc. I did not want to open up Word but simply display the
invoice in a Rich Text memo control within Delphi. The user
could then print or save as he wished.
The problen was that the layout in the rtm control could not
handle the table. I was forced to use the table in order to
be able to left justify the invoice line text and right justify
the amount to get the amounts to all line up. Like below
rryrtt wer ytwrety wrt 234.00
sdssdf sdg dgsdrg dg 1234.00
I can align a line right or left but not parts of a line. This
is why I tried using tables as one would do in a Word doc.
May be I'm asking to much from the components!
Rgds
Des Tuff
|
|
| Back to top |
|
 |
Oliver Townshend Guest
|
Posted: Tue Sep 27, 2005 9:23 pm Post subject: Re: WORD_TLB Type Library Compilation Error |
|
|
| Quote: | I can align a line right or left but not parts of a line. This
is why I tried using tables as one would do in a Word doc.
May be I'm asking to much from the components!
|
I've written piles of invoices using RTF for different systems, and I've
always used tables. I don't understand why you can't save the table in an
RTF file. It's very simple.
Oliver Townshend
|
|
| Back to top |
|
 |
|