VBA: Fully description of object

Questionman2

New Member
Joined
Jul 19, 2017
Messages
1
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">

<tbody style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">
[TD="class: votecell"]
0down votefavorite
[/TD]
[TD="class: postcell"] I am new to programming, so please excuse any ignorance.
I am trying to extract styles properties from a Word-template, and posting them in Excel. I want each column to contain one property (name e.g.), and each row to contain to one style.
What I have yet is something extracting all styles from the active word sheet, and writing it in the word document:
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; white-space: inherit;">Sub jkjk()
For Each Style In ActiveDocument.Styles
With ActiveDocument.Range
.InsertAfter Text:=Style.NameLocal & Chr(9) & Style.Description
.InsertParagraphAfter
.InsertParagraphAfter
End With
Next Style
End Sub</code>Is it possible to do this either more orderly (eg. name = abc, font = 12, ...) by calling each and every property of the style and extracting their value, or directly do this from Excel?
Thank you in advance.


[/TD]

</tbody>
</body>

<tbody style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;">
[TD="class: votecell"]
down votefavorite
[/TD]
[TD="class: postcell"] I am new to programming, so please excuse any ignorance.
I am trying to extract styles properties from a Word-template, and posting them in Excel. I want each column to contain one property (name e.g.), and each row to contain to one style.
What I have yet is something extracting all styles from the active word sheet, and writing it in the word document:
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; white-space: inherit;">Sub jkjk()
For Each Style In ActiveDocument.Styles
With ActiveDocument.Range
.InsertAfter Text:=Style.NameLocal & Chr(9) & Style.Description
.InsertParagraphAfter
.InsertParagraphAfter
End With
Next Style
End Sub</code>Is it possible to do this either more orderly (eg. name = abc, font = 12, ...) by calling each and every property of the style and extracting their value, or directly do this from Excel?
Thank you in advance.


[/TD]

</tbody>
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top