You are here: Office-Outlook.com  / Outlook Forum

problem in using namespace Word

Home » Outlook addins and plugins development » Developer Outlook add-ins
problem in using namespace Word [message #802] Wed, 09 August 2006 03:55 Go to next message
hamidC
Messages: 4
Registered: August 2006
Junior Member
I used the statement:

#import "C:\Program Files\Microsoft Office\Office11\MSWORD.OLB" \
rename_namespace("MSWord"),named_guids, \
raw_interfaces_only
using namespace MSWord;

to import Word library to my addin, but it came to some compile error in
msword.tlh file
Re: problem in using namespace Word [message #806] Thu, 10 August 2006 00:51 Go to previous message
hamidreza.ghader
Messages: 2
Registered: August 2006
Junior Member
I found what the problem was:
I had import mso.dll and msword.olb using these statements:
#import "C:\Program Files\Common Files\Microsoft
Shared\OFFICE11\MSO.DLL" rename_namespace("Office"),\
named_guids , raw_interfaces_only
using namespace Office;

#import "C:\Program Files\Microsoft Office\Office11\MSWORD.olb"
rename_namespace("MSWORD"), \
rename("ExitWindows","WordExitWindows"),named_guids,
raw_interfaces_only
using namespace MSWORD;
but it came to error:
fatal error LNK1179: invalid or corrupt file: duplicate comdat
"_IID_CanvasShapes"
after some searches I faound that I should remove named_guides from the
second statement. It works, but I really don't know why. Do anyone has
any idea?
hamidC++ wrote:
> I used the statement:
>
> #import "C:\Program Files\Microsoft Office\Office11\MSWORD.OLB" \
> rename_namespace("MSWord"),named_guids, \
> raw_interfaces_only
> using namespace MSWord;
>
> to import Word library to my addin, but it came to some compile error in
> msword.tlh file
Previous Topic:How to get the name or path of opened file in MSWord?
Next Topic:Word 2003 add in oddly behavior, visual studio2003
Goto Forum: