Hello Everyone,

I'm having trouble getting chinese characters to work with TypeText. When I use English, everything works great.

For example, the following statement shows up as " " in my word document.

exec sp_OAMethod @objword, 'Selection.TypeText("y")'

While I'm using T-SQL and not VBA, I figured that the people here would probably know the answer. I've been finding VBA documentation or recording word macros and translating it to work with T-SQL as there is hardly anything on intergrating Word and SQL Server. So, my appologies in advance if this is the wrong forum. If anyone knows the answer or could point me in the right direction, it'd be greatly appreciated.


Re: Issue with Selection.TypeText and Chinese Characters.


Managed to solve the issue myself by trial and error. For any that are interested, you need to change the syntax to the following.

exec sp_OAMethod @objword, 'Selection.TypeText', NULL, 'y'

..or if you are using a variable.

exec sp_OAMethod @objword, 'Selection.TypeText', NULL, @Chinese