473,320 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Is it possible to create shapes in a Word document using C#?

I'm attempting to create shapes on a Microsoft Office Word document to model the layout of tables in a room. I've found a nice article (http://support.microsoft.com/kb/316384) that demonstrates how to create tables and text, but it doesn't mention anything about shapes. Is this possible or am I just dreaming?
Apr 18 '11 #1

✓ answered by GaryTexmo

It looks like a document object has a Shapes property that will let you call an AddShape method.

http://msdn.microsoft.com/en-us/libr...ice.14%29.aspx

AddShape takes a type, then 4 integers that define a rectangle. For the type, it looks like you use the following:

http://msdn.microsoft.com/en-us/libr...shapetype.aspx

Hopefully that helps you :)

3 3134
GaryTexmo
1,501 Expert 1GB
It looks like a document object has a Shapes property that will let you call an AddShape method.

http://msdn.microsoft.com/en-us/libr...ice.14%29.aspx

AddShape takes a type, then 4 integers that define a rectangle. For the type, it looks like you use the following:

http://msdn.microsoft.com/en-us/libr...shapetype.aspx

Hopefully that helps you :)
Apr 18 '11 #2
Is there anything that you don't know?

Luckily I managed to find out about this before I read your reply, but I'm now having a problem with formatting (color, border size). Could you point me in the right direction for this? My shapes have a dark blue centre with an even darker border at the moment, which seems to be my default in Word.

I'll have to credit you in my project for sure Gary :)
Apr 18 '11 #3
GaryTexmo
1,501 Expert 1GB
I can't take credit for that one ;) I googled around and found the information, them compiled the links. But hey, no problem! :D

Haha, I'd imagine you did the same steps I did. Glad you got it figured out though! If there's anything else I can help with, please let me know. I've never done this either so I'm googling/experimenting along with you, but sometimes two heads are better than one.
Apr 18 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: di | last post by:
I have a Access Database, and I would like to create a word document that (preferable would filter)links to ACCESS table or query. I would like to print the word document on the filtered record...
3
by: Michael Tkachev | last post by:
Hi Everybody! I have a problem. When I get a HTML of my page that I'm rendering. I need to generate a word-document from a html. And than I have to send this word-document to the users through...
0
by: jayne | last post by:
I have created the following code the first part works to create a word document with but when I have created the document and existed word, I then click the button again to open up the document to...
3
by: Ken Swinton | last post by:
I am developing a program that gathers inspection visit details and save them in string variables. I need to output this information to a Word template. I have attempted to use Bookmarks, so far...
1
by: surveyor | last post by:
Hello everyone, I have used Microsoft Word 10 library for creating word document in VB6. But I see it is very slow. Please tell me how I can do faster? For creating document content I use...
1
by: prashantmalikiec | last post by:
Hi all, i am new to .net and my problem is that i am not able to create a ms word document using .net. i dont know how to write some text(hello world) into the word document thanks,...
0
by: menelty | last post by:
Hi, I have been trying to create a word document using vb.net. I have several fields I wish to populate so I am using a MS Access back end to spit out the requested data for these fields as the...
1
by: sharayu | last post by:
Hi I am doing a small project in vb.I want to create a word document consisting values in table format.The values are to be taken from the excel files.This is to be done using VB.The word file...
0
by: gopikrishnan | last post by:
Hi to all, i am developing a java project which workes in linux. I need to create a Word document through my java program, rep_path = --FIlePath-- fso = new File(rep_path); if (!...
0
by: PracticalApps | last post by:
I looked to find a canned solution to create a Word document in my application and just couldn't find anything that just gets to the point. I would think, and I may be making too strong of an...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.