Skip to main content

[archive] Hello, Micr35180

  • April 29, 2008
  • 22 replies
  • 0 views

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:

22 replies

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
Mail merge does not necessarily require direct file access. If you use COM, you can use your own COBOL logic. Mailmerge example attached. Just compile and debug (to get to see what it does)

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
Sorry didnt send earlier - have been away. Gisle has posted similar/same solution - works well. If you need further let me know.
Keith

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
Thank you both very much for all your help.
I get an error when I try to run the sample program (see attachment).
Also, Does AcuODBC work with Word? It does with Access and Excel.
That would simplify my project quite a bit.

Thanks again!

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
Thank you both very much for all your help.
I get an error when I try to run the sample program (see attachment).
Also, Does AcuODBC work with Word? It does with Access and Excel.
That would simplify my project quite a bit.

Thanks again!

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
Now that was odd.
If you step through it in the debugger, can you tell which of these two lines that cause the problem (fillrow.cbl):

           MODIFY  wrdCell          Range::InsertAfter(Txt-1(1:P1-S)).
           MODIFY  wrdTable         @Cell(Col-I, 2) GIVING wrdCell.


Perhaps you need to create the definition file over again. Try use AxDefGen to create a defintion file on your computer.

As for ACUODBC, Microsoft word can access ODBC datasources, but that is a different story, I have no examples of this.
Honestly, I am not so sure it will simplify it. Using COM you have all the control you want in your COBOL program, using ODBC you will have to rely on external set up. But that is your call.

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
Hi Gisle,

This line seems to be the culprit
MODIFY  wrdTable         @Cell(Col-I, 2) GIVING wrdCell.

However, I remembered doing this in your advanced windows course in London.
I've attached the sample here - hope you don't mind.
This one does work, so hopefully it helps the original poster.

Shaun

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
Thanks Shaun! :-)

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
Thanks Shaun! :-)

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
I tried the set of programs and got the following error message:

c:\\WINNT\\system32\\Kernel32.dll: Program missing or inaccessible
Cobol error at 000167 in CreateMailMergeDataFile
Called from 00007B in WordMailMerge

The said dll file sits in c:\\windows\\system32

I have ran these suit of programs before but on an older windows box, but I need to re-visit this for a new solution that is required for one of our customers.

Other than creating the directory structure, is there anyway to tell the cobol programs where the dll file resides? I cannot see the said directory structure defined within the programs.

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
This may not be what you are looking for, but I think this is using the PATH for that system. If C:\\windows\\system32 is part of the path, it should find it.

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\\Documents and Settings\\bjd>echo %PATH
%PATH

C:\\Documents and Settings\\bjd>set PATH
Path=C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\Program Files\\QuickTime\\QTSystem\\;C:\\Acucorp\\Acucbl721\\AcuGT\\BIN;C:\\Program Files\\OpenVPN\\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH

C:\\Documents and Settings\\bjd>

As you can see from the above the directory is within the PATH. However, i have used Acuthin onto a unix platform and the programs run, as I need to make it work using
this, I will press on and not worry about it not working on my PC. However, if anyone knows the answer to this I would be gratefull to have it.

Regards
Brian

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\\Documents and Settings\\bjd>echo %PATH
%PATH

C:\\Documents and Settings\\bjd>set PATH
Path=C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\Program Files\\QuickTime\\QTSystem\\;C:\\Acucorp\\Acucbl721\\AcuGT\\BIN;C:\\Program Files\\OpenVPN\\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH

C:\\Documents and Settings\\bjd>

As you can see from the above the directory is within the PATH. However, i have used Acuthin onto a unix platform and the programs run, as I need to make it work using
this, I will press on and not worry about it not working on my PC. However, if anyone knows the answer to this I would be gratefull to have it.

Regards
Brian

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
Don't create the directory. If, as in your case, the kernel32.dll is in another directory, just change the code.
Also, if you have a recent version of Acu, you don't have to set the path at all, just use kernel32.dll. The runtime will then automatically check the system directories for it.

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
How do I change the font size?

I have tried the code below:

USE wrdSelection @Font
INQUIRE ^Bold IN FBOLD
INQUIRE ^Name IN FNAME
INQUIRE ^Size IN FSIZE
MODIFY ^Size = 8
MODIFY ^Name = "Courier New"
END-USE.

I have made the field FSIZE PIC S9(8), S9(2) but it does not display within the
message box and it also does not change the font size to 8. It stays at 12. I am
guessing that the parameter is Size, If I enter a parameter of ^XXXX it complains
when I compile but does not complain with ^Size. So I think Size should be a correct
parameter.

Please help.

Regards
Brian

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
Font size is of type single, which is not supported in ACUCOBOL-GT. The reality behind this is that you can always set the font (Word will accept literals), but you will not be able to retrieve the current setting and restore it. If you would like this capability, please contact tech support and request an enhancement request.

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
Font size is of type single, which is not supported in ACUCOBOL-GT. The reality behind this is that you can always set the font (Word will accept literals), but you will not be able to retrieve the current setting and restore it. If you would like this capability, please contact tech support and request an enhancement request.

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
Hello Gisle,
Thanks for the info. But I still do not know the syntax of how to change the Font Size. The Modify Line that you see trying to change the font size to 8 does not work.

Please can you provide the syntax of how to change the font size.

Also the syntax of turning on underline.

It would also be usefull to know how to set tab settings.

More importantly, how can you determine which version of Word a customer is on. From my testing I have established that the WORD.DEF is for Office 2000, which I have, and the MSWRD.DEF is for, I assume, Office 2005. 2 of my colleagues are still on Office 97.

If I use the MSWRD.DEF copy library the program falls over with error message Member Not Found. If my colleages run with either copy libraries they get the same error message.

One of the reasons I did not go down this route before, was because you needed different definition files. If you have a 97 version, please could you send that to me.

Currently within my testing I have the 2 copy libraries defined within the same program, and I am re-compiling the program commenting out the copy library that is not required. Obviously I cannot do this for real, I will need to call 3 separate programs depending on which version Office a user is on.

I could have one defined within the calling program and just start the link to Word, but then would have to find out which version the user is on and call the apropriate program.

So please can you provide the syntax code of how you find out these details.

My email address is bd@interchangegroup.com if it is easier to email me back.

Thanks in anticipation.

Regards
Brian
Please note I have sent this as a personnel reply but thought best to also add it here.

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
Brian,

You should be able to get the version by using:

05 WORD-APP HANDLE OF APPLICATION OF WORD.
...
INQUIRE WORD-APP @VERSION IN WORD-VERSION.

However, we have been interfacing to Word since Word97 and are still using the same def file for newer versions and all seems to work fine. I'm sure depending what you want to do, this may not be the case, though.

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:

But I still do not know the syntax of how to change the Font Size. The Modify Line that you see trying to change the font size to 8 does not work.

Unfortunately, I expressed myself wrong in my previous email. You cannot set the font size in Acu as it is. Feel free to ask for an enhancement request, it should say: "Enhance ACUCOBOL-GT ActiveX methods to support floating point types VT-R4 and VT-R8".

Also the syntax of turning on underline.

If you want to work on Office, you need to know your .def file. If you look in the def file you should search for "class @font", among the members of the class you will find "Underline", you set this just like you set the Bold example previously shown in this thread. Note however, there are multiple options for "Underline", these are expressed as constants in the .def file. Actually using constants is the better way, for "Bold" for instance you have "wdToggle".

It would also be usefull to know how to set tab settings.

If you go to http://msdn.microsoft.com/en-us/library/bb726434.aspx you will find the Microsoft online reference for all Office versions, albeit examples are not in COBOL, they are usually in VBA and thus reasonably straight forward to figure out. There you can search around and find things, likely also for setting tabs.

More importantly, how can you determine which version of Word a customer is on.

I see you got an answer on this.

Please note I have sent this as a personnel reply but thought best to also add it here.

Do not send personal messages, I don't respond. The purpose of this forum is to share information, personal is not sharing.

Also, let me emphasize that what we provide here is help to get going with ACUCOBOL-GT syntax and examples where there are some. We are by no means experts on MS Office API or other COM objects for that matter. If you are lucky, somebody has already been into the issue and there is an answer. However, we don't do the research for you. You find how things are handled in other languages, and have a problem figuring out how to do it with ACUCOBOL-GT, you can try post a question here.

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:

But I still do not know the syntax of how to change the Font Size. The Modify Line that you see trying to change the font size to 8 does not work.

Unfortunately, I expressed myself wrong in my previous email. You cannot set the font size in Acu as it is. Feel free to ask for an enhancement request, it should say: "Enhance ACUCOBOL-GT ActiveX methods to support floating point types VT-R4 and VT-R8".

Also the syntax of turning on underline.

If you want to work on Office, you need to know your .def file. If you look in the def file you should search for "class @font", among the members of the class you will find "Underline", you set this just like you set the Bold example previously shown in this thread. Note however, there are multiple options for "Underline", these are expressed as constants in the .def file. Actually using constants is the better way, for "Bold" for instance you have "wdToggle".

It would also be usefull to know how to set tab settings.

If you go to http://msdn.microsoft.com/en-us/library/bb726434.aspx you will find the Microsoft online reference for all Office versions, albeit examples are not in COBOL, they are usually in VBA and thus reasonably straight forward to figure out. There you can search around and find things, likely also for setting tabs.

More importantly, how can you determine which version of Word a customer is on.

I see you got an answer on this.

Please note I have sent this as a personnel reply but thought best to also add it here.

Do not send personal messages, I don't respond. The purpose of this forum is to share information, personal is not sharing.

Also, let me emphasize that what we provide here is help to get going with ACUCOBOL-GT syntax and examples where there are some. We are by no means experts on MS Office API or other COM objects for that matter. If you are lucky, somebody has already been into the issue and there is an answer. However, we don't do the research for you. You find how things are handled in other languages, and have a problem figuring out how to do it with ACUCOBOL-GT, you can try post a question here.

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
Hello Rob Stan and Gisle,

I have established that the word.def definition file works with word 2000, word2002 and word2003, our customer is on word2003 so I will code our program to just use the word.def copy library.

Thanks very much for your help so far.

However, I still need to know why I cannot change the Font Size? I understand that it cannot be stored, but I am not worried about that, I can
assume that the default size is 12, and if I give the user a method to change it I need it to work. I have tried the code below:

USE wrdSelection @Font
INQUIRE ^Bold IN FBOLD
INQUIRE ^Name IN FNAME
MODIFY ^Bold = 1
MODIFY ^Italic = 1
MODIFY ^Underline = 1
MODIFY ^Size = 8
MODIFY ^Name = "Courier New"
END-USE.

All of them work bar the ^Size command. I have looked on the net at VB
scripts etc. and they suggest that the syntax above is correct.

Any ideas?

Also is there a way of setting up TAB positions?

I know how to output a Tab using hex settings, so that is not a problem, but it will rely upon what are the preset settings.

If you can provide the code I will be very gratefull.

Regards
Brian

[Migrated content. Thread originally posted on 28 April 2008]

Keith,
In the last post you said you could do a mail merge with MS Word & Vision files. Could you post any information you have here?

Thank you very much
Milk5600:confused:
Hello Gisle,
Sorry I have just seen your reply, so please disregard my previous entry.

Thanks very much for your help.

Regards
Brian