H
Harald Fröba
Hi,
I'm using the dsofile to manipulate the document properties of word files
with visual c++.
I can manipulate existing entries( custom/built in ).
Now I want to add custom entries.
To manage this I use the Add method of the CustomProperties interface.
HRESULT Add( [in] BSTR sPropName, [in] VARAINT* Value, [out, retval]
CustomProperty** ppDocProperty );
Here is my Code:
BSTR Name = L"NewField"
VARIANT Value;
Value.vt = VT_BSTR;
Value.bstrVal = L"NewValue";
Hr = AutoWrap( DISPATCH_METHOD, &Result, CustomPropertiesP, L"Add", 2,
Value, Name );
I have tried all of the possible Values, but I get always the error:
Hr 0x80020008 Falscher Variablentyp.
I have a demo program in visual basic and there is no problem to add
properties.
Can anyone help me to interpret the [in] VARAINT* Value in C++ or have
anyone a sample code snippet
in C++?
Any help would be appreciated!!
Thanks for your time.
Regards,
Harald
I'm using the dsofile to manipulate the document properties of word files
with visual c++.
I can manipulate existing entries( custom/built in ).
Now I want to add custom entries.
To manage this I use the Add method of the CustomProperties interface.
HRESULT Add( [in] BSTR sPropName, [in] VARAINT* Value, [out, retval]
CustomProperty** ppDocProperty );
Here is my Code:
BSTR Name = L"NewField"
VARIANT Value;
Value.vt = VT_BSTR;
Value.bstrVal = L"NewValue";
Hr = AutoWrap( DISPATCH_METHOD, &Result, CustomPropertiesP, L"Add", 2,
Value, Name );
I have tried all of the possible Values, but I get always the error:
Hr 0x80020008 Falscher Variablentyp.
I have a demo program in visual basic and there is no problem to add
properties.
Can anyone help me to interpret the [in] VARAINT* Value in C++ or have
anyone a sample code snippet
in C++?
Any help would be appreciated!!
Thanks for your time.
Regards,
Harald