×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

CreateObject to Attachment Object conversion

CreateObject to Attachment Object conversion

CreateObject to Attachment Object conversion

(OP)
Hi everybody,

I wrote some code as shown below, which allows a user to create an embedded word document from a file, this works fine. But I've been asked if I can change this so that it's an attachment instead, anybody now how I can change this code to do that.

Thanks

Matt       

        Dim uiw As New NotesUIWorkSpace
    Dim wordobj As Variant, handle As Variant, csz As String
    Dim app As Variant
    Dim uid As NotesUIDocument
    Set uid = uiw.CurrentDocument
    Call uid.GotoField("letter")
    
    Call uid.CreateObject("Word Document","","mypath")
    Set handle = uid.GetObject ("Word Document")
    Call handle.activate
    Set app = handle.Application
    
Call app.ActiveDocument.Bookmarks("supplier"). _Range.InsertAfter((uid.FieldGetText("supplier")))

RE: CreateObject to Attachment Object conversion

Do you want to make it an attachment after it's been embedded ?

RE: CreateObject to Attachment Object conversion

(OP)
Yes that's right, because my users want to simply click on an attachment to view it, instead of having to view an embedded document. But I did it this way, so that I could put data into the word document.

RE: CreateObject to Attachment Object conversion

Well, unless anyone has a better idea, you'll have to do it the hard way. That means that the only way I can think of to switch an embedded object to an attachment is to save it to disk, remove it from the document, then attach it as an attachment.
It would be simpler to have users write up their info in Word or Excel and have them attach it instead of embedding it, no ?

Pascal.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close