RE: Setting RelativeHorizontalPosition causes "Parameter not found

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.

.



Relevant Pages

  • Re: Offshore Outsourcing
    ... > posting out of context and altered text to defend your lie. ... >> focused upon programming and related TECHNICAL issues. ... > groups for the very good reason that a TECHNICAL issue, jerk face, is ... Does this mean you are incapable of outlining 3 on-topic technical posts ...
    (comp.programming)
  • Re: Giving an application a window icon in a sensible way
    ... *does* provide valuable information in his snappy posts. ... Java that aren't better answered by surfing Sun's site... ... not interested in learning the Java programming language at all. ...
    (comp.lang.java.programmer)
  • Re: windows Vista Media center, About TV Guide
    ... They don't see "dotnet" anywhere in the description. ... in the dropdown posts to... ... general questions about programming applications using Microsoft's .NET ... can't While there may be some here who know about Vista Media Center ...
    (microsoft.public.dotnet.general)
  • Re: seebs/schildt
    ... The vast majority if your recent posts have been not about C, ... object-oriented programming in the need for Kyrsten Nygaard to ... strayed into an area that would expose the regs' ignorance, ... is his puzzlement...that someone could master programming (something ...
    (comp.lang.c)
  • Re: Posting Moratorium
    ... If you program for a living or have written a non-trivial program as a hobby then you know enough about programming to make a qualified contribution to this group. ... Similarly, if you engage with other human beings, as a paid worker, or employer, or a consumer of services, or more directly with government, say as a pupil at a government-run school, or as a soldier, or as a voter, then you know enough about political theory to have a qualified opinion on it. ... The problem I see with Nilges' posts is that whilst we can have a sensible discussion on the intersection between programming and social behaviour - clearly some programming is very obviously a social activity, some is quite solitary - programming itself is a very small subset of the wider ocean of human behaviour, it is a very small subset even of economic behaviour. ...
    (comp.programming)