Comments and forms not working together - please please anyone

G

gravesen

HI I have a little case where I click a button choose a sentence in on
language and then the sentence is inserted in another language in th
document. When the sentence is inserted in the document I have
comment on the sentence telling the user what this means in his/her ow
language.

This is want I use for this and it works fine.

Sub VisøgeretveletableretfirmaItalien()
'
' VisøgeretveletableretfirmaItalien Makro
' Makro indspillet 27-01-2004 af
' "&chr(10)&"lgr
'
Selection.TypeText Text:= _
"We are looking for an established company who can represent u
in Italy."
Selection.Comments.Add Range:=Selection.Range
Selection.TypeText Text:="Vi søger et veletableret firma, der ka
repræsentere os i Italien."
ActiveWindow.ActivePane.Close
End Sub

I now have some standard text in the documents when you with a dro
down can choose between some other words. Because this is done wit
forms and the document is protected I get the following error. If
delete the comments the sentence is inserted and it works fine. BUT
would like to have the comments very much :-(

This method is for use because the document is protected.

CAN ANYONE PLEASE GIVE ME IDEAS FOR THIS

Thanks
Lars Gravese
 
J

J. Verdaasdonk

Hi Lars, :)

You’re code runs fine over here I get the sentence and the comment????
You say you’re using this in an protected document (For Forms?), if s
you should unprotect the sheet before inserting.

Use something like this:

Code
-------------------
Sub VisøgeretveletableretfirmaItalien()
'
' VisøgeretveletableretfirmaItalien Makro
' Makro indspillet 27-01-2004 af
' "&chr(10)&"lgr
'
ActiveDocument.Unprotect Password:="LGravessen"

Selection.TypeText Text:= _
"We are looking for an established company who can represent us in Italy."
Selection.Comments.Add Range:=Selection.Range
Selection.TypeText Text:="Vi søger et veletableret firma, der kan repræsentere os i Italien."
ActiveWindow.ActivePane.Close

ActiveDocument.Protect Password:="LGravessen", NoReset:=False, Type:= _
wdAllowOnlyFormFields
End Su
 
G

gravesen

Hi Joost

Thanx for your reply. I dont think that I managed to explain th
problem in my little project. :)

The problem is that multiple users have to use the form in a document
where they have to be able to insert sentences that translate int
others language, which I can see that you have read and tested in m
macros :)

The essential problem is that I use letters with specific standar
sentences and some of them with multiple choise like differen
attentions (Dear Sir, Dear Ms, Dear Sirs Etc.) Those are in a dropdow
menu from a formfield and to be able to activate this formfield I hav
to protect the section in the dot-file.

This is where when tryin to run the original macros the error occure
stating that the document is protected. Eventhough when choosing End i
writes the senteces but dont write the comments. HELP will b
appreciated

Thanks
Lars Gravese
 
D

Doug Robbins - Word MVP

Use

Sub VisøgeretveletableretfirmaItalien()
'
' VisøgeretveletableretfirmaItalien Makro
' Makro indspillet 27-01-2004 af
' "&chr(10)&"lgr
'
ActiveDocument.Unprotect
Selection.TypeText Text:= _
"We are looking for an established company who can represent us
in Italy."
Selection.Comments.Add Range:=Selection.Range
Selection.TypeText Text:="Vi søger et veletableret firma, der kan
repræsentere os i Italien."
ActiveWindow.ActivePane.Close
ActiveDocument.Protect wdAllowOnlyFormFields, NoReset
End Sub


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
G

gravesen

HI Joost
When working a litle with your example I now got it working fine
THANKS. I do have a small extra question that I would like to ask.

When insering the sentence I would like to be abble to choose betwee
some different words in a drop down. Do you know how I can make
dropdown in the macro on just one word and add 3 or 4 extra possibl
words.

If I look at this code:
------------------------------------
Sub VisøgeretveletableretfirmaItalien()
'
' VisøgeretveletableretfirmaItalien Makro
' Makro indspillet 27-01-2004 af
' "&chr(10)&"lgr
'
ActiveDocument.Unprotect Password:="LGravessen"

Selection.TypeText Text:= _
"We are looking for an established company who can represent us i
Italy."
Selection.Comments.Add Range:=Selection.Range
Selection.TypeText Text:="Vi søger et veletableret firma, der ka
repræsentere os i Italien."
ActiveWindow.ActivePane.Close

ActiveDocument.Protect Password:="LGravessen", NoReset:=False, Type:
_
wdAllowOnlyFormFields
End Sub


-----------------------------------------

I choose one sentence and this is inserted. But as u see I have Ital
and would like to have a drop down in the letter where I can choss
England, USA and so on.

Any help would be ever so nice :)

Thanks
Lars Gravese
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top