Word object and its Enumerations

I need to store various printer settings into the database (this would be done by the user thru “Maintain Printers” screen).

1.In what format I’ve to store the printer information (paper source, papersize …)?2.Then how do I apply the stored values to word object. (It’ll accept only its enumerations)?

[1209 byte] By [Karthikeyan] at [2007-12-16]
# 1
You could create your own class or structure to store these settings and make each property of the appropriate Word enumeration type.
jmcilhinney at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# General...
# 2

Hi Jmchilhinney

Thanks for the quick reply !


But, I have some more doubts regarding this , can we have a chat now in MSDN or yahoo or MSN. Which ever is suitable for you? After that I’ll sum up our conversation and post that into the forum. pls mail me your mail Id or reply here if MSDN chat is ok for you.
You can see my email Id in my profile.

Karthikeyan at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# General...
# 3
I'm afraid I tend not to use instant messaging. If you have specific questions I suggest you post them here.
jmcilhinney at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# General...
# 4

Ok...

Can you elaborate your answer?

See, for one type of printer I may get the Paper source as “Tray 1”, “Tray 2” and for another type of printer I may get it as “Upper Tray”, “Lowe Tray” as strings….so, how do I map these with the correct word object enumeration? Say word will have “wdUpperTray”, “wdLoweTray” etc.

As its enums.

Karthikeyan at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# General...
# 5
It's up to you to provide the mappings yourself. You could present the options to your user in ComboBoxes, with the DisplayMember set to the string you get from the printer and the ValueMember set to the Word enumerated value.
jmcilhinney at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# General...
# 6
You can find the names and values of the members of any Word enumeration using the Object Browser and Immediate Window in the Word VBA IDE. Here are the members of the Word 2003 WdPaperTray enumeration and their values, copied and pasted from the Immediate Window. Just declare constants with these values for use in your C# code. ? wdPrinterAutomaticSheetFeed 7 ? wdPrinterDefaultBin 0 ? wdPrinterEnvelopeFeed 5 ? wdPrinterFormSource 15 ? wdPrinterLargeCapacityBin 11 ? wdPrinterLargeFormatBin 10 ? wdPrinterLowerBin 2 ? wdPrinterManualEnvelopeFeed 6 ? wdPrinterManualFeed 4 ? wdPrinterMiddleBin 3 ? wdPrinterOnlyBin 1 ? wdPrinterPaperCassette 14 ? wdPrinterSmallFormatBin 9 ? wdPrinterTractorFeed 8 ? wdPrinterUpperBin 1 -- Brendan Reynolds (Access MVP) wrote in message news:c5b08797-be18-47ec-8e41-e480fb72f1f2@discussions.microsoft.com...
> Ok... >
> Can you elaborate your answer? > > >
> See, for one type of printer I may get the Paper source as "Tray 1",
> "Tray 2" and for another type of printer I may get it as "Upper Tray",
> "Lowe Tray" as strings..so, how do I map these with the correct word
> object enumeration? Say word will have "wdUpperTray", "wdLoweTray" etc. >
> As its enums. >
>
MVPUser at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# General...