Solved

opening a ms-word document

Posted on 2001-06-11
6
230 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

708 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

19 Experts available now in Live!

Get 1:1 Help Now