Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

how to use Word Automation methods by MFC

Posted on 2003-11-21
5
Medium Priority
?
333 Views
Last Modified: 2013-11-20
I met some mistakes when using Word Type library,I don't know how to use these argument.
for example,when I call Shapes.AddTextbox() as below:

COleVariant bgAnchor;
Shape myShape = myShapes.AddTextbox(wdTextOrientationHorizontal,0, 0, 72, 384, bgAnchor);

I met an error "type mistake".

there is a simular mistake when I call Shapes.AddPicture() as below:
COleVariant m_True((short)TRUE),m_False((short)FALSE);

Range myRange = mySelection.GetRange();
InlineShapes myPic = myShapes.AddPicture("D:\\MyDocments\\My Pictures\\IMG_8415.JPG",
               m_False, m_False, 0, 0, 72, 384, myrange);

I need answer urgently,please help me.
0
Comment
Question by:jinyleo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:_corey_
ID: 9801465
Have you tried: msoTextOrientationHorizontal ?

Does it say what parameter it errors on?
0
 

Author Comment

by:jinyleo
ID: 9801711
msoTextOrientationHorizontal is VBA constant, I can not complied when i used this,VC6 complier said this keyword is not declared. I copyed an header file from network which contains wdTextOrientationHorizontal constant,then complied successful.I do not think this is the reason.
0
 
LVL 8

Expert Comment

by:_corey_
ID: 9803123
Yea, I noticed that too.  I just thought it might be defined.

So that's not the issue then, but what variable does it say has the "type mistake" ?
0
 

Author Comment

by:jinyleo
ID: 9805077
I do not know yet, perhaps I need to define variant  bgAnchor with clear type, but which type should be approriate here?

0
 
LVL 8

Accepted Solution

by:
_corey_ earned 750 total points
ID: 9806815
I'm not sure what needs to be set for that variant.  Perhaps you don't need it then, just take out that parameter and see if you still get the same problem.  At least for the shapes AddTextbox call.
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question