Template menu in 2003 and 2010
hi,
my office has mix of word 2003 , 2010 users, , have startup template builds forms menu in word 2003 adding menu main menu. when run same template in word 2010 (without modification 2010), puts menu on add-ins tab instead of creating new tab on ribbon. pretty far.
but, there way, in vba code of template macros to: 1) learn version of word running macro, , 2) direct macro construct menu main tab on ribbon instead of in default add-ins location?
since macro runs each time word opens, , removes existing menu before creating new one( might have new or modified selections on it), not seem option merely move menu manually after appears on add-ins menu new tab using ribbon customization, , prefer not have detour learning xml scripting task done--but if it's easiest way.
tia,
peter
hi,
please test following code, hope helpful:
'########################
'get version of word.
'########################
public function getwordversion() string
getwordversion = application.version
end function
sub demo()
dim strwordver stringstrwordver = getwordversion
if strwordver = "11.0" then
'processing 1...
elseif strwordver = "14.0" then'processing 2...
end if
end sub
note: need add macro code that have been designed word 2003 & 2010 to "processing1" & "processing2"
"11.0" = word 2003
"14.0" = word 2010
best regards.
william zhou
technet community support
Microsoft Office > Word IT Pro Discussions
Comments
Post a Comment