O
Oliverm
Dear all
I made an macro that opens the "format -> Characters" dialog
"wdDialogFormatDefineStyleFont". See below.
Unfortunately, I haven't figured out how the receive the return values
such as style, font, color, ... my aim is to format a text field of a
form - and later a text in word - with those parameters.
I can return the color as a two digit number. E.g black would be 01.
Unfortunately, this is obviuously something different from what
ForeColor is expecting.
My somebody lend me an helping hand? Suggestions and tips are very
welcome too.
Kind Regards
Oliver
(Same posting in microsoft.public.de.word)
Code:
-----------------
Function getColor() As Integer
' Thanks to http://www.tech-archive.net/Archive/Word/microsoft.public.word.vba.general/2006-11/msg00416.html
Dim MyFontDlg As Dialog
Static MyFontColor
Static MyFontStyle
Dim res
Set MyFontDlg = Application.Dialogs(wdDialogFormatDefineStyleFont)
MyFontDlg.Color = MyFontColor
res = MyFontDlg.Display
MyFontColor = MyFontDlg.Color
Debug.Print ("Font Color:" & MyFontColor)
getColor = MyFontColor
End Function
I made an macro that opens the "format -> Characters" dialog
"wdDialogFormatDefineStyleFont". See below.
Unfortunately, I haven't figured out how the receive the return values
such as style, font, color, ... my aim is to format a text field of a
form - and later a text in word - with those parameters.
I can return the color as a two digit number. E.g black would be 01.
Unfortunately, this is obviuously something different from what
ForeColor is expecting.
My somebody lend me an helping hand? Suggestions and tips are very
welcome too.
Kind Regards
Oliver
(Same posting in microsoft.public.de.word)
Code:
-----------------
Function getColor() As Integer
' Thanks to http://www.tech-archive.net/Archive/Word/microsoft.public.word.vba.general/2006-11/msg00416.html
Dim MyFontDlg As Dialog
Static MyFontColor
Static MyFontStyle
Dim res
Set MyFontDlg = Application.Dialogs(wdDialogFormatDefineStyleFont)
MyFontDlg.Color = MyFontColor
res = MyFontDlg.Display
MyFontColor = MyFontDlg.Color
Debug.Print ("Font Color:" & MyFontColor)
getColor = MyFontColor
End Function