10 Replies - 2161 Views - Last Post: 20 January 2012 - 06:39 PM Rate Topic: -----

#1 mardTanha  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 05-January 12

use ms word direction right to lef in c#

Posted 19 January 2012 - 04:52 AM

hi ,is this possible?
i have ms word 2010 installed i added a reference named: "Microsoft.Office.Interop.Word" but i still do not know how to use it?
Is This A Good Question/Topic? 0
  • +

Replies To: use ms word direction right to lef in c#

#2 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5676
  • View blog
  • Posts: 12,194
  • Joined: 02-June 10

Re: use ms word direction right to lef in c#

Posted 19 January 2012 - 07:09 AM

Newbie/Rookie said:

I have a little programming experience but I need to write ...


You need to start there. I can't say "I have little experience in speaking Russian, but I have been assigned to write a mystery novel in Russian. Can you help me?"

We can help you by saying "First learn basic programming and the language of C#. Then take on assignments." Could someone here write this program for you? Sure. Could someone here map out all the processes you need to follow and do the Software Design part of this in the slim hope you could code it from there? Sure. But we don't volunteer to do the job that you're either getting paid for, or getting a grade for. You may want to read this.

For now, just work on the lessons. Do a self-teaching book from cover to cover. Then consider writing a program.

Don't try to create a useful working program to fit a need of yours (or a for-pay contract) as your introduction to coding project. When you are learning to code you don't know enough to code a program, let alone know how to engineer the architecture of a program. It would be like saying "I don't know how to read sheet music, or play an instrument. I think I'll write a 3 act opera as my first learning experience."

I don't say this to be mean. We've seen lots of new coders take this approach and we know it doesn't work. Trying to design your own programs before you understand the basics of the code language you've chosen just leads to problems, frustrations, and 'swiss-cheese' education (lots of holes).


Resources, references and suggestions for new programmers. - Updated Jan 2012
Spoiler


View PostmardTanha, on 19 January 2012 - 05:52 AM, said:

hi ,is this possible?
i have ms word 2010 installed i added a reference named: "Microsoft.Office.Interop.Word" but i still do not know how to use it?


You use it like any other namespace. There are object classes and methods. Have you done any research on it and read about it on MSDN?
Was This Post Helpful? 0
  • +
  • -

#3 mardTanha  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 05-January 12

Re: use ms word direction right to lef in c#

Posted 19 January 2012 - 07:22 AM

i know how namespace works
using Word=Microsoft.Office.Interop.Word; (from msdn)

i know how to work with default namespaces like system ,... but i confused about ms reference working.
i have a text that i want to change its direction to right to left without change the layout i mean save it as rtl in ltr layout, ms word have a two button for this: Left-To-Right Text Direction and Right-To-Left Text Direction, can i use them into my C# Application or not?

sorry for en.
Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5676
  • View blog
  • Posts: 12,194
  • Joined: 02-June 10

Re: use ms word direction right to lef in c#

Posted 19 January 2012 - 07:37 AM

Can you use Word's buttons in your application? No.

You can write your own code for your own buttons to do the same thing.

Quote

i know how to work with default namespaces like system ,... but i confused about ms reference working.


Welcome to learning something new. New things will always be confusing at first. Experiment. Try new things out. Read about how to use the new methods. Trial and error are the best teachers.

A requirement of this site is you have to make a good faith effort to code a solution for your problem. You have to actually try. We are not hear to do free coding for those too lazy to make an effort.

What does this error mean?

Suggestion:
Don't replace lines of code that don't work. Instead comment them out and put your new attemps below that. This will keep you from re-trying the same ideas over and over. Also, when you come back to us saying "I've tried this 100 different ways and still can't get it", we can actually see what you tried. So often a failed attempt is very very close and just needs a little nudge in the right direction. So if we can say "See what you did in attempt 3... blah blah" it helps a lot

// Try #1 - May 1, 0900hrs
//    code
//    code  
//    code
// Try #2 - May 2, 1700hrs   Okay, plan B.  What if I do it *this* way
//    code
//    code  
//    code
// Try #14 - May 3, 0500hrs after 5 cans of RedBull.  Maybe I should get some sleep. I can't think of anything else but this last idea
    code
    code  
    code


If you are using Visual Studio you can select a block of lines and hit control+k control+c (Kode Comment) to comment it out. control+k control+u (Kode Uncomment) to uncomment a selected block.
Was This Post Helpful? 0
  • +
  • -

#5 blogwhodle  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 49
  • Joined: 18-January 12

Re: use ms word direction right to lef in c#

Posted 19 January 2012 - 09:00 PM

Why are you trying to access word anyway??? :hammer:
Was This Post Helpful? 0
  • +
  • -

#6 Curtis Rutland  Icon User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4577
  • View blog
  • Posts: 8,019
  • Joined: 08-June 10

Re: use ms word direction right to lef in c#

Posted 20 January 2012 - 10:12 AM

Quote

Why are you trying to access word anyway???


There are plenty of legitimate reasons for that, otherwise MS wouldn't have included Interop assemblies, and even VSTO. Let's not get so suspicious.
Was This Post Helpful? 0
  • +
  • -

#7 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5676
  • View blog
  • Posts: 12,194
  • Joined: 02-June 10

Re: use ms word direction right to lef in c#

Posted 20 January 2012 - 10:24 AM

I don't think blogwhodle was being suspicious of anything more than the OP going off in the wrong direction.

If the OP is building their own application then why are they trying to make use of Word's language features? It doesn't make sense. Its almost like they think they don't have to write code to get right-to-left support.

The OP even said they wanted to use the right-to-left button from Word in their application.

Quote

ms word have a two button for this: Left-To-Right Text Direction and Right-To-Left Text Direction, can i use them into my C# Application or not?


I think blogwhodle was just trying to find out how confused the OP is. Personally I recognize they are so far confused that I don't want to try to hand-hold them through their education; that's why I gave them the resources list so they can build up their skills and understanding before trying to tackle this project.
Was This Post Helpful? 0
  • +
  • -

#8 mardTanha  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 05-January 12

Re: use ms word direction right to lef in c#

Posted 20 January 2012 - 11:18 AM

View PosttlhIn`toq, on 20 January 2012 - 10:24 AM, said:

Personally I recognize they are so far confused that I don't want to try to hand-hold them through their education; that's why I gave them the resources list so they can build up their skills and understanding before trying to tackle this project.

thanks for help!
i wrote the code myself
==
i just Thought my problem was a solved problem that everybody knows except me otherwise i never ever post it like my first post.
you almost make fun of me,
so you are SO Professional and have a good time.
Was This Post Helpful? 0
  • +
  • -

#9 blogwhodle  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 49
  • Joined: 18-January 12

Re: use ms word direction right to lef in c#

Posted 20 January 2012 - 05:21 PM

So if you are trying to make text go right to left why don't you just reverse it??? And if you are putting it in a textbox just right align it and reverse it. Why do you need word for that is what I am asking???? Basically I want to know why you need word anyway because if it was that simple and you still want word, you must have a reason that I didn't get.
:hammer:

View PosttlhIn`toq, on 20 January 2012 - 10:24 AM, said:

I don't think blogwhodle was being suspicious of anything more than the OP going off in the wrong direction.

If the OP is building their own application then why are they trying to make use of Word's language features? It doesn't make sense. Its almost like they think they don't have to write code to get right-to-left support.

The OP even said they wanted to use the right-to-left button from Word in their application.

Quote

ms word have a two button for this: Left-To-Right Text Direction and Right-To-Left Text Direction, can i use them into my C# Application or not?


I think blogwhodle was just trying to find out how confused the OP is. Personally I recognize they are so far confused that I don't want to try to hand-hold them through their education; that's why I gave them the resources list so they can build up their skills and understanding before trying to tackle this project.

I just wanted to know why the person is trying to access word for just right-to-lefting something. I mean you could just reverse the order of the chars and right align it.

This post has been edited by blogwhodle: 20 January 2012 - 05:21 PM

Was This Post Helpful? 0
  • +
  • -

#10 Curtis Rutland  Icon User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4577
  • View blog
  • Posts: 8,019
  • Joined: 08-June 10

Re: use ms word direction right to lef in c#

Posted 20 January 2012 - 06:08 PM

Because many languages are read right-to-left, like Arabic. And it behaves differently. For instance, selection and copying behave differently.
Was This Post Helpful? 0
  • +
  • -

#11 blogwhodle  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 49
  • Joined: 18-January 12

Re: use ms word direction right to lef in c#

Posted 20 January 2012 - 06:39 PM

View PostCurtis Rutland, on 20 January 2012 - 06:08 PM, said:

Because many languages are read right-to-left, like Arabic. And it behaves differently. For instance, selection and copying behave differently.

Oh!!!!!!!!
How could I not realize that!
:hammer:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1