to AndyAinscow
yes I know, but what you wrote - Visible is undefinied (I tryied TRUE) and documents.Add takes 4 parameters not 2. And I have no idea what they means and what values are enabled - everything is variant and where is the doc?

<The document has an Open command - you can use that to open an existing doc.> - the doc is an existing winword document on your hard disc, you supply the path as one of the params of the open call. Yes params supplied to the functions are usually as variant. You will see in the generated .cpp/.h files the params required. ***Important, typo - it is the Documents (plural) that has the Open command).

'You know I wold love to search here just if I had the premium membership' - sorry I didn't realise search wasn't available as a free service. The hard way is to look at the list of closed questions, word automation seems to be a not uncommon topic.
There should be a number of automating word examples on the microsoft site. Try "word automation" AND MFC as the search params.

What I need is to create (manualy) a document with custom properties and connect some fields in the document with these properties. Then when I open the document, I need to set these properties and update the fields before PrintOut is called.

I found an example how to read properties but its real pain with GetIDsOfNames and InvokeHelper methods and even that it works I have no Idea how to set the properties.

I also found CustomProperties class in my generated code (in msword.h) but when I try this:

and this:
-----
LPDISPATCH lpDisp;
lpDisp = testDoc.GetCustomDocumentProperties();
CustomProperties rProp(lpDisp);
long lCount = rProp.GetCount();
-----
then an exception is raised as I wrote before.
I am quite desperate...

The video will let you know the exact process to import OST/PST files to the cloud based Office 365 mailboxes. Using Kernel Import PST to Office 365 tool, one can quickly import numerous OST/PST files to Office 365. Besides this, the tool also comes…