Hi there
I am fairly new in the Axapta world, I am having trouble integrating Axapta
to Microsoft Word.
The problems I am having are:
Which functions can I call, and how do I pass the parameters? So far, I
have been doing a lot of guessing....
I might say, that earlier I have been quite spoilt, as I used to develop in
Delphi, where integration is seamless.
I have this example to work on:
COM wordApplication;
COM wordDocuments;
COM wordDocument;
COM wordRange;
COM font;
COM Selection;
wordApplication = new COM('Word.application');
wordapplication.visible(TRUE);
worddocuments = wordApplication.Documents();
worddocument = wordDocuments.add();
wordDocument.activate();
wordRange = wordDocument.range(0,0);
wordRange.Insertafter('Hello from Axapta, Mr Fudge');
wordRange.bold(true);
wordRange = wordDocument.range(11,17);
wordRange.italic(true);
selection = wordRange;
font = selection.font();
font.color(111111);
The result of running this code, is opening Word with a new document, and
printing "Hello from Axapta, Mr Fudge". The word "Axapta" is italic and
green.
Some of my firsthand questions are:
How do I retreive the current cursor position?
I should think that the following lines should do it:
vertPos = Selection.Information[wdVerticalPositionRelativeToPage];
horizPos = Selection.Information[wdHorizontalPositionRelativeToPage];
And in stead of calling font.color(111111) I would like to call
font.color(wdColorGreen).
The constants wdVerticalPositionRelativeToPage,
wdHorizontalPositionRelativeToPage and wdColorGreen are all defined in MS
Word, but I cannot figure out how to pass the from Axapta.
Also, I would like hints on starting Word with a new document based on a
template, in the templates are a couple of bookmarks, which I should be
able to write to.
OK, that was a big mouthfull, I hope any of you have some good hints,
either for the specifics, or for a good place to read about integration to
word from Axapta.
Thanks in advance, Jens Fudge
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.