RE: Setting RelativeHorizontalPosition causes "Parameter not found
- From: v-phuang@xxxxxxxxxxxxxxxxxxxx ("Peter Huang" [MSFT])
- Date: Wed, 03 May 2006 07:58:15 GMT
Hi Jeff,
I suggest you import the type into C++, so that we can programming much
easier.
Here is my test code which works fine.
//Added the stuff below into header.
#include <atlbase.h>
#include <atlstr.h>
//import the necessary library
#import "libid:2DF8D04C-5BFA-101B-BDE5-00AA0044DE52" version("2.3")
lcid("0") auto_search auto_rename
#import "libid:0002E157-0000-0000-C000-000000000046" version("5.3")
lcid("0") auto_search auto_rename
#import "libid:00020905-0000-0000-C000-000000000046" version("8.3")
lcid("0") auto_search auto_rename
int _tmain(int argc, _TCHAR* argv[])
{
::CoInitialize(NULL);
Word::_ApplicationPtr wdApp;
wdApp.CreateInstance(_T("Word.Application"));
wdApp->Visible = true;
Word::DocumentsPtr wdDocs = wdApp->Documents;
Word::_DocumentPtr wdDoc = wdDocs->Add();
wdApp->ActiveWindow->ActivePane->View->SeekView =
Word::wdSeekCurrentPageHeader;
_bstr_t text = ::SysAllocString(_T("VOID"));
_bstr_t fontname = ::SysAllocString(_T("Arial Black"));
Word::ShapePtr shape =
wdApp->Selection->HeaderFooter->Shapes->AddTextEffect(Office::MsoPresetTextE
ffect::msoTextEffect2,text,fontname,1,Office::MsoTriState::msoFalse,Office::
MsoTriState::msoFalse,0,0);
shape->TextEffect->put_NormalizedHeight(Office::MsoTriState::msoFalse);
shape->Line->put_Visible(Office::MsoTriState::msoFalse);
shape->Fill->put_Visible(Office::MsoTriState::msoTrue);
shape->Fill->Solid();
shape->Fill->ForeColor->__RGB = RGB(192,192,192);
shape->Fill->Transparency = 0.5;
shape->Rotation = 315;
shape->put_LockAspectRatio(Office::MsoTriState::msoTrue);
shape->Height = 2.82f*72;
shape->Width = 5.64f*72;
shape->Select();
shape->RelativeHorizontalPosition =
Word::wdRelativeHorizontalPositionMargin;
shape->RelativeVerticalPosition = Word::wdRelativeVerticalPositionMargin;
shape->Left = Word::wdShapeCenter;
shape->Top = Word::wdShapeCenter;
wdApp->ActiveWindow->ActivePane->View->SeekView = Word::wdSeekMainDocument;
::CoUninitialize();
return 0;
}
Best regards,
Peter Huang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Follow-Ups:
- RE: Setting RelativeHorizontalPosition causes "Parameter not found
- From: Jeff Mastry
- RE: Setting RelativeHorizontalPosition causes "Parameter not found
- References:
- Setting RelativeHorizontalPosition causes "Parameter not found" er
- From: Jeff Mastry
- RE: Setting RelativeHorizontalPosition causes "Parameter not found" er
- From: "Peter Huang" [MSFT]
- RE: Setting RelativeHorizontalPosition causes "Parameter not found
- From: Jeff Mastry
- Setting RelativeHorizontalPosition causes "Parameter not found" er
- Prev by Date: Re: Paragraph's size
- Next by Date: Re: Paragraph's size
- Previous by thread: RE: Setting RelativeHorizontalPosition causes "Parameter not found
- Next by thread: RE: Setting RelativeHorizontalPosition causes "Parameter not found
- Index(es):
Relevant Pages
|