Is is possible to write a macro to alter the company information in the properties within wo
Hello,
I am currently working on a problem for a Client. We offer a service using Word.
When the Client downloads a Word document via our website our company name appears in the properties option from the file menu, which is obviously undesirable for the company using the document.
Is it possible to write a VB macro that we can run to allow a different company name to be displayed? We can then use the code to change the company name before they download the document
If so, I would appreciate some pointers. I think the real problem is that I am unsure of where our company information is being inherited from, and thus stuck as to how to change this via VB.
Any help very much appreciated.
Adam.
captainahab wrote: |
| Hello, I am currently working on a problem for a Client. We offer a service using Word. When the Client downloads a Word document via our website our company name appears in the properties option from the file menu, which is obviously undesirable for the company using the document. Is it possible to write a VB macro that we can run to allow a different company name to be displayed? We can then use the code to change the company name before they download the document If so, I would appreciate some pointers. I think the real problem is that I am unsure of where our company information is being inherited from, and thus stuck as to how to change this via VB. Any help very much appreciated. Adam.
|
|
Adam,
I wouldn't be surprized if you were using a template, and the company name was in the template.
You should be able to modify the properties of the document before you send it. You will have to use the DSOFile component through COM interop to do this. Basically, it will let you set the company property of the file (something that the OS manages to some degree, not word).
Check out Knowledge Base article 224351, titled "Dsofile.dll lets you edit Office document properties without Office in Visual Basic .NET 2003 and in Visual Basic .NET 2002", located at:
http://support.microsoft.com/?kbid=224351
Hope this helps.
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com