Hi,

I have a problem with InsertSymbol that I have seen nowhere else. I need to
insert a character from a symbol font and want it to have symbol behaviour,
i.e. if I mark a range containing the character afterwards and select another
font, the symbol character won't change. This might sound simple and I
thought it was, but generally it doesn't work the first few times...

In a fresh Word application I use the code below to insert a symbol
character with some other symbol font than Symbol and the first and sometimes
first few character will be wrong:

Sub InsertWayPointerSymbol()
Dim rng As Range
Dim i As Long
Set rng = Selection.Range.Duplicate
For i = 0 To 30
rng.InsertSymbol AscW("n"), "Marlett"
rng.MoveEnd wdCharacter
rng.Font.Name = "Times New Roman"
rng.Collapse wdCollapseEnd
Next i
End Sub

I assume this has something to do with the font not being fully initialized
before I start, but can I force it to be somehow?

I tried simply inserting one character and removing it first, but the
problem is I do not know how many times I need to fix it. On some users
machines the problem occurs for a longer time.

Would I be guaranteed that it will work if I add a style containing the
symbol font to the template that is used? Or can I programmatically create a
style or something to force the font to be initialized?

For readers familiar with WordML it might be helpfull to see the difference
in wordml between the incorrect and correct character:

Incorrect:
<w:r>
<w:rPr>
<w:rFonts w:ascii="Marlett" w:h-ansi="Marlett" />
<wx:font wx:val="Marlett" />
<wx:sym wx:font="Marlett" wx:char="F06E" />
</w:rPr>
<w:t>n</w:t>
</w:r>
Correct:
<w:r>
<w:rPr>
<w:rFonts w:ascii="Marlett" w:h-ansi="Marlett" />
<wx:font wx:val="Marlett" />
</w:rPr>
<w:sym w:font="Marlett" w:char="F06E" />
</w:r>

Greatful for any suggestions!
/Anna

Re: InsertSymbol inserts symbol as formated text the first time by Klaus

Klaus
Wed May 04 19:59:37 CDT 2005

Hi Anna,

Looks like a bug to me. It doesn't happen with my usual settings =
(Normal.dot ...), but does when I start Word2003 with the /a switch.

As a work-around, you could use the dialog to insert the symbol (at =
least, the first time... your code seems to work fine after that):
With Dialogs(wdDialogInsertSymbol)
.Font =3D "Marlett"
.CharNum =3D AscW("n")
.Execute
End With

Unfortunately, Microsoft doesn't have a web interface that allows users =
to report bugs.
Respectively, all existing web interfaces I have used in the past later =
were discovered to be black holes.

You could try to report the problem to PSS, but they a) probably won't =
know how to deal with it, b) will give you a hard time, c) you'll have =
to look out you don't have to pay for it d) PSS may swamp you with =
support offers once you have given your personal information/address:
http://support.microsoft.com/oas/default.aspx?ln=3Den-us&sd=3Doffn&prid=3D=
6685&gprid=3D36084

Regards,
Klaus


"Anna Neiderud" <AnnaNeiderud@discussions.microsoft.com> wrote:
> Hi,
>=20
> I have a problem with InsertSymbol that I have seen nowhere else. I =
need to=20
> insert a character from a symbol font and want it to have symbol =
behaviour,=20
> i.e. if I mark a range containing the character afterwards and select =
another=20
> font, the symbol character won't change. This might sound simple and I =

> thought it was, but generally it doesn't work the first few times...
>=20
> In a fresh Word application I use the code below to insert a symbol=20
> character with some other symbol font than Symbol and the first and =
sometimes=20
> first few character will be wrong:
>=20
> Sub InsertWayPointerSymbol()
> Dim rng As Range
> Dim i As Long
> Set rng =3D Selection.Range.Duplicate
> For i =3D 0 To 30
> rng.InsertSymbol AscW("n"), "Marlett"
> rng.MoveEnd wdCharacter
> rng.Font.Name =3D "Times New Roman"
> rng.Collapse wdCollapseEnd
> Next i
> End Sub
>=20
> I assume this has something to do with the font not being fully =
initialized=20
> before I start, but can I force it to be somehow?
>=20
> I tried simply inserting one character and removing it first, but the=20
> problem is I do not know how many times I need to fix it. On some =
users=20
> machines the problem occurs for a longer time.
>=20
> Would I be guaranteed that it will work if I add a style containing =
the=20
> symbol font to the template that is used? Or can I programmatically =
create a=20
> style or something to force the font to be initialized?
>=20
> For readers familiar with WordML it might be helpfull to see the =
difference=20
> in wordml between the incorrect and correct character:
>=20
> Incorrect:
> <w:r>
> <w:rPr>
> <w:rFonts w:ascii=3D"Marlett" w:h-ansi=3D"Marlett" />
> <wx:font wx:val=3D"Marlett" />
> <wx:sym wx:font=3D"Marlett" wx:char=3D"F06E" />
> </w:rPr>
> <w:t>n</w:t>
> </w:r>
> Correct:
> <w:r>
> <w:rPr>
> <w:rFonts w:ascii=3D"Marlett" w:h-ansi=3D"Marlett" />
> <wx:font wx:val=3D"Marlett" />
> </w:rPr>
> <w:sym w:font=3D"Marlett" w:char=3D"F06E" />
> </w:r>
> =20
> Greatful for any suggestions!
> /Anna

Re: InsertSymbol inserts symbol as formated text the first time by AnnaNeiderud

AnnaNeiderud
Mon May 09 02:31:02 CDT 2005

Thanks for your support!

It looked great, but unfortunately I managed to reproduce the problem even
with that solution. Now I found another way to go - I use symbol fields
instead, i.e.:

Dim f As Field
Set f = rng.Fields.Add(rng)
f.Code.Text = " symbol " & AscW("n") & "\f ""Marlett"""

/Anna

"Klaus Linke" wrote:

> Hi Anna,
>
> Looks like a bug to me. It doesn't happen with my usual settings (Normal.dot ...), but does when I start Word2003 with the /a switch.
>
> As a work-around, you could use the dialog to insert the symbol (at least, the first time... your code seems to work fine after that):
> With Dialogs(wdDialogInsertSymbol)
> .Font = "Marlett"
> .CharNum = AscW("n")
> .Execute
> End With
>
> Unfortunately, Microsoft doesn't have a web interface that allows users to report bugs.
> Respectively, all existing web interfaces I have used in the past later were discovered to be black holes.
>
> You could try to report the problem to PSS, but they a) probably won't know how to deal with it, b) will give you a hard time, c) you'll have to look out you don't have to pay for it d) PSS may swamp you with support offers once you have given your personal information/address:
> http://support.microsoft.com/oas/default.aspx?ln=en-us&sd=offn&prid=6685&gprid=36084
>
> Regards,
> Klaus
>
>
> "Anna Neiderud" <AnnaNeiderud@discussions.microsoft.com> wrote:
> > Hi,
> >
> > I have a problem with InsertSymbol that I have seen nowhere else. I need to
> > insert a character from a symbol font and want it to have symbol behaviour,
> > i.e. if I mark a range containing the character afterwards and select another
> > font, the symbol character won't change. This might sound simple and I
> > thought it was, but generally it doesn't work the first few times...
> >
> > In a fresh Word application I use the code below to insert a symbol
> > character with some other symbol font than Symbol and the first and sometimes
> > first few character will be wrong:
> >
> > Sub InsertWayPointerSymbol()
> > Dim rng As Range
> > Dim i As Long
> > Set rng = Selection.Range.Duplicate
> > For i = 0 To 30
> > rng.InsertSymbol AscW("n"), "Marlett"
> > rng.MoveEnd wdCharacter
> > rng.Font.Name = "Times New Roman"
> > rng.Collapse wdCollapseEnd
> > Next i
> > End Sub
> >
> > I assume this has something to do with the font not being fully initialized
> > before I start, but can I force it to be somehow?
> >
> > I tried simply inserting one character and removing it first, but the
> > problem is I do not know how many times I need to fix it. On some users
> > machines the problem occurs for a longer time.
> >
> > Would I be guaranteed that it will work if I add a style containing the
> > symbol font to the template that is used? Or can I programmatically create a
> > style or something to force the font to be initialized?
> >
> > For readers familiar with WordML it might be helpfull to see the difference
> > in wordml between the incorrect and correct character:
> >
> > Incorrect:
> > <w:r>
> > <w:rPr>
> > <w:rFonts w:ascii="Marlett" w:h-ansi="Marlett" />
> > <wx:font wx:val="Marlett" />
> > <wx:sym wx:font="Marlett" wx:char="F06E" />
> > </w:rPr>
> > <w:t>n</w:t>
> > </w:r>
> > Correct:
> > <w:r>
> > <w:rPr>
> > <w:rFonts w:ascii="Marlett" w:h-ansi="Marlett" />
> > <wx:font wx:val="Marlett" />
> > </w:rPr>
> > <w:sym w:font="Marlett" w:char="F06E" />
> > </w:r>
> >
> > Greatful for any suggestions!
> > /Anna
>