Solved

opening a ms-word document

Posted on 2001-06-11
6
231 Views
Last Modified: 2010-04-06
I open a MS-Word document by (Delphi4):

try
    word := CreateOleObject('Word.Application');
except

end;
word.Visible := True;
word.Documents.Add;

Next I would like to open a style (memo.dot) and then set the top margin to 1.5cm and the left margin to 2.5cm

Can you give me the code for this?

Thanks in advance
jupe
0
Comment
Question by:jupe
  • 3
  • 2
6 Comments
 
LVL 1

Accepted Solution

by:
MaxSCZ earned 200 total points
ID: 6176661
Hi,
you can open

try
  word := GetActiveOleObject('Excel.Application');
except
  word := CreateOleObject('Word.Application');
end;

Word.Documents.Open ('C:\My Documents\memo.dot');

word.Visible := True;


//Set the margin in the Memo.DOT

Bye Max
0
 
LVL 2

Expert Comment

by:danysz
ID: 6176662
hi

1. u can open as a document the 'memo.dot' as a file and u will get a new document based on the dot .

2. I don't think that u can change the page setup

daniel
0
 
LVL 1

Expert Comment

by:MaxSCZ
ID: 6176676
Oops
correction
try
 word := GetActiveOleObject('Word.Application');//test if word is open
except
 word := CreateOleObject('Word.Application');
end;
bye Max


0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Expert Comment

by:danysz
ID: 6176689
hi max

we are quite syncronized .

same minute.

daniel
0
 
LVL 1

Expert Comment

by:MaxSCZ
ID: 6176954
Hi Daniel yes very strange!
Bye Max ;D
0
 

Author Comment

by:jupe
ID: 6177429
first come first served.  thanks anyway to both of you.
jupe
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PDF library for Delphi 2 103
Delphi Form ownership 4 70
find a node in VST 2 63
oracle global variables 4 63
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

929 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now