I really need to know if there is a way of using visual basic to automate the task of writing information into a Microsoft Publisher 2000 template that I have created?
In VB check the References (on the Project menu) for anything that says Microsoft Publisher. This will tell you if Publisher exposes an API that you can program.
I don't have it so I can't give you a definitive answer ...
Yes theres a way but you must use this convertor code which i wrote,it is very useful for calling info from a database to a template in publisher,what is your application?
For i = 0 To 51
AnyValue = BLBoxes(i).Value
SomeValue = FCBoxes(i).Value
If BLBoxes(i).Text = "" And FCBoxes(i).Text = "" Then
Else
For j = 4 To 55
If Labels(i).Caption = Cells(k, j).Publisher Then
Cells(k + 1, j).Publisher = BLBoxes(i).Text
Cells(k + 2, j).Publisher = FCBoxes(i).Text
End If
Thanks NandJ. This is by far the most promising code snippet I have recieved to solve this problem. The application is a datasheet template. Will this work with any kind of database and do you know where I can get more info on this type of code?
The application is Access or I may use Visual Basic or Excel to hold the data as their seem to be much of it(relatively speaking) yet the data will be changed and edited in this database frequently, hence the need for a datasheet program.
Sully yourmans code is fine but if you use an If statement instead of the for loop and pass in a dild0 parameter simble ~ in instead of the publisher pointer it should help you a lot more for your specific problem
Hi Sully, I can see that u are in quite a fix.The answer from Nandj is totally wrong, whoever wrote this is one long streak of misery.I have come up against this problem before, and found my answer in a book called "Not so Basic Visual Basic" edition 4 writtn my Philip Watson.Hopefully this will put your problem to rest.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.