• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

opening a ms-word document

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
jupe
Asked:
jupe
  • 3
  • 2
1 Solution
 
MaxSCZCommented:
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
 
danyszCommented:
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
 
MaxSCZCommented:
Oops
correction
try
 word := GetActiveOleObject('Word.Application');//test if word is open
except
 word := CreateOleObject('Word.Application');
end;
bye Max


0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
danyszCommented:
hi max

we are quite syncronized .

same minute.

daniel
0
 
MaxSCZCommented:
Hi Daniel yes very strange!
Bye Max ;D
0
 
jupeAuthor Commented:
first come first served.  thanks anyway to both of you.
jupe
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now