473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Field values in word 2002

Hi,

First off: I'm totally a noob!

I want to program this in word 2002:

if the document is a .dot file then DocCode (a field name) is DocCode
if the document is a .doc file then DocCode = filename

This way the document always has the right name when printed. (a .dot
renames it self when opened to document1)

I found out that you can determine if the file is a .dot by
ActiveDocument.Type = wdTypeTemplate but I don’t no where to go from here.
Can any body help me?

Nov 21 '05 #1
3 1329
Erwin,

Probably you want some office automation using VBA

Office
http://support.microsoft.com/default...b;EN-US;311452

http://msdn.microsoft.com/office/

This are websites for this, as well are there a lot of office newsgroups

news://news.microsoft.public.office.develloper.vba

I hope this helps?

Cor
Nov 21 '05 #2
Thank you for the reply.

With help I made this:

....

If ActiveDocument.Type = wdTypeTemplate Then
ActiveDocument.CustomDocumentProperties("DocCode") = "TemplateType"
End If
If ActiveDocument.Type = wdTypeDocument Then
ActiveDocument.CustomDocumentProperties("DocCode") = "DocumentType"
....

still have to figure out how to read the filename in to change DocCode to
Filename. Any help?

"Cor Ligthert" wrote:
Erwin,

Probably you want some office automation using VBA

Office
http://support.microsoft.com/default...b;EN-US;311452

http://msdn.microsoft.com/office/

This are websites for this, as well are there a lot of office newsgroups

news://news.microsoft.public.office.develloper.vba

I hope this helps?

Cor

Nov 21 '05 #3
Erwin,

I see now that you want to make it in VBNet, however still it is easier to
ask it in the Office developper groups first, with the answer in VBA you can
mostly easy stranslate that to VBNet.

Just my idea.

Cor
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Chris J | last post by:
Hi all, ] I'm having a problem with Word 2002 when downloading a Word document with IE6. This is in an intranet application, and the download occurs through an ASP that does security checks...
11
by: David Messner | last post by:
Ok I know this is simple but the statement eludes me... I have a date field where I want the default value on the data entry form's date field to be the last date entered. I figure I can do this...
3
by: John young | last post by:
I have been looking for an answer to a problem and have found this group and hope you can assist . I have been re doing a data base I have made for a car club I am with and have been trying to...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
2
by: GeoDude | last post by:
I have a "date" field in my table in the Month/Day/Year format. I would like to change all the "Day" values to 1. There are about 2500 records to change. Is there a query to change all the "Day"...
3
by: sms1 | last post by:
My Participants table in Access 2002 contains about 1500 records. The Notes field is OLE. I want to use Insert Object to insert MS Word into the Notes field. It is easily done using: Insert...
10
by: MLH | last post by:
I have an A97 table with a Yes/No field named TowJob and a form bound to that table. The TowJob control on the form is bound to the same field. It is an option group with Yes and No bttns valued...
7
by: Andy Davis | last post by:
I have a table of data in Access 2002 which is used as the source table for a mail merge document using Word 2002 on my clients PC. The data is transferred OK but I've noticed that any dates which...
4
by: steverossiter | last post by:
Hi and thanks, I have a Journalist database for tracking writers from various magazines and would like a field that could hold the text of their articles as they are published. The Memo field...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.