Odd Behaviour with wdDialogFormatPageNumber

G

Greg Maxey

I am seeing some really odd behavior while attempting to use
Dialogs(wdDialogFormatPageNumber) using Word2003

If I start a new instance of Word, display Headers and Footers, then use the
Format Page Number icon the Format Page Number dialog opens with the number
format set to "1, 2, 3 ..." I can apply that format and then apply insert
the page number and the correct format is displayed. If I press the Format
Page Number icon the dialog again opens with the format 1, 2, 3 displayed.
Now I can change the format:

Format selected Displayed in Document Displayed in dialog when opened
again
-1-, -2-, -3- -1- -1-, -2-, -3-
a, b, c a a, b, c
A, B, C A A, B, C
i, ii, iii i i, ii,
iii
I, II, III I I, II, III

All as expected.

Now if I open a new instance of Word, display Headers and Footer, and then
use the following macro code:

Sub Test()
Dim dlg As Dialog
Set dlg = Dialogs(wdDialogFormatPageNumber)
dlg.Show
Set dlg = Nothing
End Sub

the Format Page Number dialog opens with the number format set to "1, 2, 3."
I can apply that format and then apply insert the page number and the
correct format is displayed. If I run the macro the second time the dialog
opens again with the format 1, 2, 3 displayed. All is still good, but here
is where the problems start. If I change the format as follows, here is the
results:

Format selected Displayed in Document Displayed in dialog when opened
again
-1-, -2-, -3- I -1-, -2-, -3-
a, b, c i a, b, c
A, B, C A A, B, C
i, ii, iii a i, ii,
iii
I, II, III 1st I, II, III


In addition, if I set the format to -1-, -2-, -3- with the Format Page
Number icon and then display that dialog with the icon again it properly
shows -1-, -2-, -3- in the dialog number format fields. However, if I set
it to -1-, -2-, -3- using the icon and then display it again using the
macro, the dialog Number format field is blank.

I am stumped. Any ideas as to why this occurs?
 
J

Jean-Guy Marcil

Greg Maxey was telling us:
Greg Maxey nous racontait que :
I am seeing some really odd behavior while attempting to use
Dialogs(wdDialogFormatPageNumber) using Word2003

If I start a new instance of Word, display Headers and Footers, then
use the Format Page Number icon the Format Page Number dialog opens
with the number format set to "1, 2, 3 ..." I can apply that format
and then apply insert the page number and the correct format is
displayed. If I press the Format Page Number icon the dialog again
opens with the format 1, 2, 3 displayed. Now I can change the
format:

Format selected Displayed in Document Displayed in dialog when
opened again
-1-, -2-, -3- -1- -1-, -2-,
-3-
a, b, c a a, b,
c
A, B, C A A, B, C
i, ii, iii i
i, ii, iii
I, II, III I I,
II, III

All as expected.

Now if I open a new instance of Word, display Headers and Footer, and
then use the following macro code:

Sub Test()
Dim dlg As Dialog
Set dlg = Dialogs(wdDialogFormatPageNumber)
dlg.Show
Set dlg = Nothing
End Sub

the Format Page Number dialog opens with the number format set to "1,
2, 3." I can apply that format and then apply insert the page
number and the correct format is displayed. If I run the macro the
second time the dialog opens again with the format 1, 2, 3 displayed.
All is still good, but here is where the problems start. If I change
the format as follows, here is the results:

Format selected Displayed in Document Displayed in dialog when
opened again
-1-, -2-, -3- I -1-, -2-,
-3-
a, b, c i a, b,
c
A, B, C A A, B, C
i, ii, iii a
i, ii, iii
I, II, III 1st I, II,
III


In addition, if I set the format to -1-, -2-, -3- with the Format
Page Number icon and then display that dialog with the icon again it
properly shows -1-, -2-, -3- in the dialog number format fields.
However, if I set it to -1-, -2-, -3- using the icon and then display
it again using the macro, the dialog Number format field is blank.

I am stumped. Any ideas as to why this occurs?

I saw the exact same behaviour.

All I can say is that many functions launched through VBA behave differently
from those the supposedly exact same functions launched from the UI. Try
controlling the Cross-Reference dialog box with VBA...

I guess you could escalate it with the People at MSFT because it does look
like a bug, an obscure one but one nevertheless!

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
G

Greg Maxey

Thanks JGM. I don't really know how to elevate something to MS. Now that I
know that it isn't just me I leave the sleeping dog lie.
 
J

Jean-Guy Marcil

Greg Maxey was telling us:
Greg Maxey nous racontait que :
Thanks JGM. I don't really know how to elevate something to MS. Now
that I know that it isn't just me I leave the sleeping dog lie.

Just post a message in the private group with the ESC prefix in the subject
line.

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top