October 29th, 2012, 07:59 AM
bug using interop to change style
Hi, I don't know if this is the place correct. I explain my problem:
I have a document with three paragraphs and various styles:
FontName = Arial
Size = 12
1 Paragraph: STYLE (estilo1 + Times New Roman + size 10)
2 paragraph: STYLE (estilo1)
3 paragraph STYLE (Normal - default style of documents)
My selection is located in position 0 of document (1 character of 1 paragraph), then execute this code:
Dim estiloActual as Style = Me.InternalDocument.Styles("estilo1")
.AutomaticallyUpdate = false
.BaseStyle = "Normal"
.NextParagraphStyle = "estilo1"
This code causes a change in style in 1 paragraph. Change of "estilo1 + Times New Roman + size 10" to "estilo1".
The objective of the code from Word and pretend it does not change the results in the same outcome.
I made the same changes I intend to do in word, recording a macro and is exactly the same code I try to run, but there is no way,
for programming, do not change the paragraph style of the current selection.
Anybody can help me?
Thanks for advance.
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!