I am looking for a way how to sign a Word document using OLE automation.
Is there a macro of WordBasic object which I could use?
Something like Signatures.Add in VBA.
Thanks for help.
I know that MS Word allows users to choose how they want the paste to be depending on whether the pasting is from another software or same document or a different document. Is it possible to obtain that content source information from VBA? Thanks!
If you want to get information about a source of data in the clipboard, comming form outside application - sorry, it's impossible.
MSDN wrote:
The clipboard is a set of functions and messages that enable
applications to transfer data. Because all applications have access to
the clipboard, data can be easily transferred between applications or
within an application.
The function to get such of information does NOT exist!
Note: that VBA can get some information via OleAutomation (COM):
This overview does not describe how to copy and paste linked or
embedded objects. For information on these subjects, see the Component
Object Model (COM) documentation.
More information about VBA + Clipboard you can find here: Visual Basic for Applications/Clipboard VBA
i have tried adding a reference to a DLL from a Macro project in ms word. the dll has been build using MS Visual web Express 2010 with this official MS Knowledgebase article
http://support.microsoft.com/kb/317535
but im getting this error when trying to add it to my macro as a reference:
error http://img29.imageshack.us/img29/5859/13082012111759.png
As said, i followed all steps in the knowledgebase article.
What can i do?
Your component/class needs to be com-visible!
Try to specify the ComVisibleAttribute.
Then it must be registered with your system.
I am trying to move a VBA macro code from Excel 2003 to Excel 2011.
The macro requires sending an Email from Outlook. However, when I went to Tool > References to add the Outlook Object Library, it does not show up in the List box.
How do I go about adding the reference in so i can access Outlook?
As of my knowledge Office Automation in the MAC world is somehow limited. Please see this discussion. Also this one in a Microsoft Forum..
You can add reference by using Browse option.
You just need to add reference to the file "MSOUTL.OLB"
In my system I have it in "C:\Program Files\Microsoft Office\Office12\MSOUTL.OLB" , In your system it could be in different folder.
I want to create a program that could generate reports from an ms access database and place it on ms word, how can I do that. Please help, I dont have any idea on how to do this.
If you're doing this from vb.net, it seems to me that it would be simpler to automate Word, which has no difficulty utilizing Jet/ACE data as data source. I don't see any reason to involve the Access application in this, unless you have complex logic that needs to be executed within Access to get correct results in Word. For instance, Word doesn't do parent/child data display very well, but Access reports do that very easily.
Another question is the final disposition of the results. It may be that you don't need Word at all, e.g., if you're using Word for nothing more than generating PDFs. In that case, it might make more sense to create Access reports and output those to PDF (there's an add-in available for for A2007, and in previous versions, you can use the VB automatable PDFCreator, which is free).
In short, my conclusions would be:
if you're just merging data in Word from a Jet/ACE data store, then automate Word.
if you need to execute complex logic, it's probably better to automate Access and either output Access reports directly, or automate Word from Access.
In neither case, I believe, would you be automating both Word and Access directly from your VB.NET application.
You should connect to the Access Database using a Typed Dataset.
Right-click the project, click Add New Item, select Typed Dataset, and follow the wizard.
To control Word, add a reference to Microsoft.Office.Word and use the Application class.
You can build reports in MS Access that have the Export to Word functionality built into them.
You can invoke the report from your code and then call the export functionality and give it parameters so that it will export to a .doc file that you name. You can then invoke MS Word and open the .doc file up for display.