| View previous topic :: View next topic |
| Author |
Message |
Magnus Holmberg Guest
|
Posted: Tue Nov 11, 2003 11:11 am Post subject: Table in a word document. |
|
|
I have one problem:
I have a word document where I like fill a dynamic table.
The easiest and fastest way is to use the ConvertToTalbe but what I want is
to have the format of the table defined in a Document (I like to use a
document as an template).
Is there any way to Read out what kind of format one table has from a word
document (size of columns, if the lines are visible and so on) and then use
ConvertToTable to create another table that looks the same as the one
defined in the Word document. If so, how?
|
|
| Back to top |
|
 |
Michael Cessna Guest
|
Posted: Tue Nov 11, 2003 4:08 pm Post subject: Re: Table in a word document. |
|
|
Here what you can do:
1. Open the document that has the table formatting you prefer.
2. Place your cursor in that table.
3. Select Tools>Macro>Record New Macro.
4. Click OK.
5. Select Table>AutoFormat.
6. Click Apply.
7. Stop recording the macro.
8. Take a look at the code that was generated.
9. Translate the code to Delphi and apply it to your new tables.
Note: You can still use ConvertToTable and then apply the formatting
afterwards.
Regards,
Michael Cessna
"Magnus Holmberg" <pucko (AT) linux (DOT) nu> wrote
| Quote: | I have one problem:
I have a word document where I like fill a dynamic table.
The easiest and fastest way is to use the ConvertToTalbe but what I want
is
to have the format of the table defined in a Document (I like to use a
document as an template).
Is there any way to Read out what kind of format one table has from a
word
document (size of columns, if the lines are visible and so on) and then
use
ConvertToTable to create another table that looks the same as the one
defined in the Word document. If so, how?
|
|
|
| Back to top |
|
 |
Magnus Guest
|
Posted: Tue Nov 11, 2003 10:19 pm Post subject: Re: Table in a word document. |
|
|
The thing is that this is manual. I like to Do it by code. I like to have a
dot file that users can be able to change and still want the program to be
able to understand the type of the table from the dot file.
"Michael Cessna" <MichaelRobertCessna@no%spam.Yahoo.com> wrote
| Quote: | Here what you can do:
1. Open the document that has the table formatting you prefer.
2. Place your cursor in that table.
3. Select Tools>Macro>Record New Macro.
4. Click OK.
5. Select Table>AutoFormat.
6. Click Apply.
7. Stop recording the macro.
8. Take a look at the code that was generated.
9. Translate the code to Delphi and apply it to your new tables.
Note: You can still use ConvertToTable and then apply the formatting
afterwards.
Regards,
Michael Cessna
"Magnus Holmberg" <pucko (AT) linux (DOT) nu> wrote in message
news:3fb0c3cf$1 (AT) newsgroups (DOT) borland.com...
I have one problem:
I have a word document where I like fill a dynamic table.
The easiest and fastest way is to use the ConvertToTalbe but what I want
is
to have the format of the table defined in a Document (I like to use a
document as an template).
Is there any way to Read out what kind of format one table has from a
word
document (size of columns, if the lines are visible and so on) and then
use
ConvertToTable to create another table that looks the same as the one
defined in the Word document. If so, how?
|
|
|
| Back to top |
|
 |
Ignacio Vazquez Guest
|
Posted: Tue Nov 11, 2003 10:36 pm Post subject: Re: Table in a word document. |
|
|
"Magnus" <pucko (AT) linux (DOT) nu> wrote in message
3fb16075$1 (AT) newsgroups (DOT) borland.com...
| Quote: | The thing is that this is manual. I like to Do it by code.
|
And if you look at the code that's generated after you've done it manually
you'll probably have a better understanding of how to do it.
Cheers,
Ignacio
|
|
| Back to top |
|
 |
Magnus Holmberg Guest
|
Posted: Wed Nov 12, 2003 9:22 am Post subject: Re: Table in a word document. |
|
|
What I understand is how to create a table that looks like that table in the
document (From this code generated by the macro). But that's not the major
problem. The problem is how to get This information in Runtime. (in the
code) so I can do this automaticly. I mean I can't give the user the Source
Code and an delphi installation and say if you want another format of the
table. Generate a macro and then modify the lines 1432 to 1454 in the
source code and rebuild the application.
So my Question is more like, is there any way to read out the AutoFormat
type for an existing table?
As far as I can see the AuotFormat is an procedure to set AutoFormat for a
table. Not to read the settings.
"Ignacio Vazquez" <ivazquezATorioncommunications.com> wrote
| Quote: | "Magnus" <pucko (AT) linux (DOT) nu> wrote in message
3fb16075$1 (AT) newsgroups (DOT) borland.com...
The thing is that this is manual. I like to Do it by code.
And if you look at the code that's generated after you've done it manually
you'll probably have a better understanding of how to do it.
Cheers,
Ignacio
|
|
|
| Back to top |
|
 |
Michael Cessna Guest
|
Posted: Wed Nov 12, 2003 11:08 pm Post subject: Re: Table in a word document. |
|
|
As long as you can get the Table object in code...you can read the
formatting properties from the table.
Mike
"Magnus" <pucko (AT) linux (DOT) nu> wrote
| Quote: | The thing is that this is manual. I like to Do it by code. I like to have
a
dot file that users can be able to change and still want the program to be
able to understand the type of the table from the dot file.
"Michael Cessna" <MichaelRobertCessna@no%spam.Yahoo.com> wrote in message
news:3fb10991$1 (AT) newsgroups (DOT) borland.com...
Here what you can do:
1. Open the document that has the table formatting you prefer.
2. Place your cursor in that table.
3. Select Tools>Macro>Record New Macro.
4. Click OK.
5. Select Table>AutoFormat.
6. Click Apply.
7. Stop recording the macro.
8. Take a look at the code that was generated.
9. Translate the code to Delphi and apply it to your new tables.
Note: You can still use ConvertToTable and then apply the formatting
afterwards.
Regards,
Michael Cessna
"Magnus Holmberg" <pucko (AT) linux (DOT) nu> wrote in message
news:3fb0c3cf$1 (AT) newsgroups (DOT) borland.com...
I have one problem:
I have a word document where I like fill a dynamic table.
The easiest and fastest way is to use the ConvertToTalbe but what I
want
is
to have the format of the table defined in a Document (I like to use a
document as an template).
Is there any way to Read out what kind of format one table has from a
word
document (size of columns, if the lines are visible and so on) and
then
use
ConvertToTable to create another table that looks the same as the one
defined in the Word document. If so, how?
|
|
|
| Back to top |
|
 |
Magnus Holmberg Guest
|
Posted: Thu Nov 13, 2003 9:28 am Post subject: Re: Table in a word document. |
|
|
It's probably me that are to stupid.
Can you give me an example and you will "Make my day".
For example, how can I read the table format.. (to se for example if it's
wdTableFormatSimple1)
Thanks.
BR
Magnus.
"Michael Cessna" <MichaelRobertCessna@no%spam.Yahoo.com> wrote
| Quote: | As long as you can get the Table object in code...you can read the
formatting properties from the table.
Mike
"Magnus" <pucko (AT) linux (DOT) nu> wrote in message
news:3fb16075$1 (AT) newsgroups (DOT) borland.com...
The thing is that this is manual. I like to Do it by code. I like to
have
a
dot file that users can be able to change and still want the program to
be
able to understand the type of the table from the dot file.
"Michael Cessna" <MichaelRobertCessna@no%spam.Yahoo.com> wrote in
message
news:3fb10991$1 (AT) newsgroups (DOT) borland.com...
Here what you can do:
1. Open the document that has the table formatting you prefer.
2. Place your cursor in that table.
3. Select Tools>Macro>Record New Macro.
4. Click OK.
5. Select Table>AutoFormat.
6. Click Apply.
7. Stop recording the macro.
8. Take a look at the code that was generated.
9. Translate the code to Delphi and apply it to your new tables.
Note: You can still use ConvertToTable and then apply the formatting
afterwards.
Regards,
Michael Cessna
"Magnus Holmberg" <pucko (AT) linux (DOT) nu> wrote in message
news:3fb0c3cf$1 (AT) newsgroups (DOT) borland.com...
I have one problem:
I have a word document where I like fill a dynamic table.
The easiest and fastest way is to use the ConvertToTalbe but what I
want
is
to have the format of the table defined in a Document (I like to use
a
document as an template).
Is there any way to Read out what kind of format one table has from
a
word
document (size of columns, if the lines are visible and so on) and
then
use
ConvertToTable to create another table that looks the same as the
one
defined in the Word document. If so, how?
|
|
|
| Back to top |
|
 |
Michael Cessna Guest
|
Posted: Thu Nov 13, 2003 7:18 pm Post subject: Re: Table in a word document. |
|
|
I would recommend that you read the Microsoft Word Visual Basic Reference
(VBAWD10.CHM for Word XP).
Here's an example from this reference:
If ActiveDocument.Tables.Count >= 1 Then
If ActiveDocument.Tables(1).AutoFormatType <= wdTableFormatSimple3 Then
ActiveDocument.Tables(1).AutoFormat _
Format:=wdTableFormatClassic1
End If
End If
Regards,
Michael Cessna
"Magnus Holmberg"
| Quote: | It's probably me that are to stupid.
Can you give me an example and you will "Make my day".
For example, how can I read the table format.. (to se for example if it's
wdTableFormatSimple1)
Thanks.
BR
Magnus.
"Michael Cessna" <MichaelRobertCessna@no%spam.Yahoo.com> wrote in message
news:3fb2bd80$1 (AT) newsgroups (DOT) borland.com...
As long as you can get the Table object in code...you can read the
formatting properties from the table.
Mike
"Magnus" <pucko (AT) linux (DOT) nu> wrote in message
news:3fb16075$1 (AT) newsgroups (DOT) borland.com...
The thing is that this is manual. I like to Do it by code. I like to
have
a
dot file that users can be able to change and still want the program
to
be
able to understand the type of the table from the dot file.
"Michael Cessna" <MichaelRobertCessna@no%spam.Yahoo.com> wrote in
message
news:3fb10991$1 (AT) newsgroups (DOT) borland.com...
Here what you can do:
1. Open the document that has the table formatting you prefer.
2. Place your cursor in that table.
3. Select Tools>Macro>Record New Macro.
4. Click OK.
5. Select Table>AutoFormat.
6. Click Apply.
7. Stop recording the macro.
8. Take a look at the code that was generated.
9. Translate the code to Delphi and apply it to your new tables.
Note: You can still use ConvertToTable and then apply the formatting
afterwards.
Regards,
Michael Cessna
"Magnus Holmberg" <pucko (AT) linux (DOT) nu> wrote in message
news:3fb0c3cf$1 (AT) newsgroups (DOT) borland.com...
I have one problem:
I have a word document where I like fill a dynamic table.
The easiest and fastest way is to use the ConvertToTalbe but what
I
want
is
to have the format of the table defined in a Document (I like to
use
a
document as an template).
Is there any way to Read out what kind of format one table has
from
a
word
document (size of columns, if the lines are visible and so on) and
then
use
ConvertToTable to create another table that looks the same as the
one
defined in the Word document. If so, how?
|
|
|
| Back to top |
|
 |
Deborah Pate (TeamB) Guest
|
|
| Back to top |
|
 |
Francis Dion Guest
|
Posted: Sat Nov 15, 2003 6:40 am Post subject: Re: Table in a word document. |
|
|
If I understand correctly, you want your application to create a Word
document with a table in it. The data would come from your application
but you would like the formating of the table to be editable by your
end-users, directly from MS-Word.
If this is indeed what you are trying to achieve, then XpertDoc is the
tool you need. It is a report generator that creates Word documents
based on Word templates. You users can easily adapt the formatting of
your report without doing any programming. All they have to do is open
the template and edit it.
You can check it out at www.xpertdoc.com
"Magnus Holmberg" <pucko (AT) linux (DOT) nu> wrote
| Quote: | I have one problem:
I have a word document where I like fill a dynamic table.
The easiest and fastest way is to use the ConvertToTalbe but what I want is
to have the format of the table defined in a Document (I like to use a
document as an template).
Is there any way to Read out what kind of format one table has from a word
document (size of columns, if the lines are visible and so on) and then use
ConvertToTable to create another table that looks the same as the one
defined in the Word document. If so, how?
|
|
|
| Back to top |
|
 |
|